"joe collins" <[EMAIL PROTECTED]> wrote on 23/03/2004
14:33:13:


> can operators be used in MySQL e.g.
>
> a table Table X with column A, column B column C
>
> All three are floats
>
> can I use
>
> select (A-B)
> from X
> where <condition>
>
>
> or will I have to so the A-B calculation in my application code instead?

Yes - MySQL has a rich set of operators. See
http://www.mysql.com/doc/en/Functions.html


> Also can I use
>
> select C from X where <condition>
>  Then
>
> update X set C = (return values got from above + New Increment)
> where <condition>

Not like that. You do it in one command
  UPDATE X SET C=C+<increment> WHERE <condition> ;

See http://www.mysql.com/doc/en/UPDATE.html

      Alec


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to