Posted by Plamen Ratchev on 01/30/07 13:47
Hi,
You do not specify what is the logic for generating the values for the
nameval column, but based on your example seems it is 2 when the values are
equal and 1 when they are different.
Based on that assumption, here is a query that will do the update:
update test
set nameval = (case when nametype1 = nametype2 then 2 else 1 end)
Regards,
Plamen Ratchev
http://www.SQLStudio.com
[Back to original message]
|