JElster
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
I just tested it with a temp table.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry the server is sql2000...
ASKER
Incorrect syntax near the keyword 'VALUES'.