Link to home
Start Free TrialLog in
Avatar of JElster
JElsterFlag for United States of America

asked on

sql server - HELP with update statement

Hi..
I need to update a table   I have a field called  HIGHEST_OF_3
and 3 sales fields,  SALE_1, SALE_2, SALE_3
I need to update the value of the HIGHEST_OF_3 with the largest value of SALES_1, or SALES_2 or SALES_3.

table looks something like this

customer id             sale 1         sale 2          sale 3              highest
1                               40               10                  90
2                              100                0                  30


thx
ASKER CERTIFIED SOLUTION
Avatar of dsacker
dsacker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JElster

ASKER

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'VALUES'.
If you're on MS SQL 2008 or higher, that works. Check your syntax. You must have parentheses like my example.

I just tested it with a temp table.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JElster

ASKER

Sorry the server is sql2000...