Subscriptions wrote:
Er... do you mean this instead?
>
> UPDATE your_table
> SET decimal_field = decimal_field + (0.15 * decimal_field);
No, but they do the same thing:
decimal_field + (0.15 * decimal_field)
= (1 * decimal_field) + (0.15 * decimal_field)
= (1 + 0.15) * decimal_field
= 1.15 * decimal_field
Would this work?
Yes.
Jenifer
----- Original Message ----- From: "Michael Stassen"
<[EMAIL PROTECTED]>
To: "Subscriptions" <[EMAIL PROTECTED]>
Cc: <mysql@lists.mysql.com>
Sent: Monday, October 03, 2005 12:25 PM
Subject: Re: Add 15% to column?
Subscriptions wrote:
I have a decimal field in my table... what would be the query to add 15%
to that number in every row? I need to mark the column up by 15% and
want to
make sure I get the query right the first time. heh
Jenifer
UPDATE your_table
SET decimal_field = 1.15 * decimal_field;
Michael
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]