
July 11th, 2016, 12:47 PM
|
Registered User
|
|
Join Date: Jul 2016
Posts: 1
Time spent in forums: 13 m 8 sec
Reputation Power: 0
|
|
Case statement within update clause
Hi,
I need to do something like this shown below in Sybase.
UPDATE Services
SET a.Description=CASE b.Mnemonic WHEN 'DES' THEN b.ItemValue END
FROM Services a, ComponentSpecValue b
WHERE a.DetailId=b.DetailId
i.e to update 'description' field in table 'Services', when the field 'Mnemonic' contains 'DES' in table ComponentSpecValue. Both these tables connected with DetailId.
The above query getting executed. But, not updating Description field at all.
Anyone have solution please.
Thanks in advance.
Makesh
|