MySQL Forums
Forum List  »  Newbie

Re: Querying
Posted by: Russell Dyer
Date: July 03, 2005 06:06PM

You didn't say which programming language API (PHP, Perl, etc.) you want to use to do this. However, at the core of whatever interface you create, you would use an UPDATE statement with a WHERE clause. It would look like this:

UPDATE table1
SET price = price * 1.1
WHERE products LIKE 'brx%';

This statement will take the current value of the column price and multiply it by 1.1 (i.e., 110%) and then set the price to that calculated value, but only where rows are found to have a product name beginning with the letters brx.

Russell Dyer

Author of "MySQL in a Nutshell" (O'Reilly 2005).

Options: ReplyQuote


Subject
Written By
Posted
July 01, 2005 09:39AM
July 03, 2005 04:32PM
Re: Querying
July 03, 2005 06:06PM
July 07, 2005 10:31AM
July 07, 2005 11:45AM
July 04, 2005 04:28AM
July 06, 2005 01:09PM
July 06, 2005 01:22PM
July 06, 2005 03:05PM
July 07, 2005 09:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.