db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamatha Kodigehalli Venkatesh" <Mamatha.Venkat...@ness.com>
Subject RE: Decode function as that in Oracle
Date Tue, 22 Feb 2011 07:42:41 GMT
Thank you so much, It works!!

 

________________________________

From: Lukas Eder [mailto:lukas.eder@gmail.com] 
Sent: Monday, February 21, 2011 5:57 PM
To: Derby Discussion
Cc: Mamatha Kodigehalli Venkatesh
Subject: Re: Decode function as that in Oracle

 

	Below query works in oracle.
	Is there equivalent in Derby?
	Update myTable set COL_1 = decode(COL_1,null,'Null', 'Mamatha') where key ='M9621'

 
In most SQL dialects, you can use the CASE statement, i.e. something like this

UPDATE myTable 
SET COL_1 = 
  (CASE WHEN COL_1 IS NULL THEN 'Null' ELSE 'Mamatha' END) 
WHERE KEY = 'M9621'


Mime
View raw message