December 21, 2010 at 11:06 am
select (if (DESCRIPTION= 'Stop save') then ('gddo'); else ('turr'); end if;) as dep
from CIRC.TAG
I get 'ORA-00907: missing right parenthesis' error message. What's the mistake.
December 21, 2010 at 2:25 pm
Mistake #1: you're obviously using Oracle 😀
#2: assuming some logic implemented into the SQL systax Oracle is using, I'd get rid of all of the semicolons, since a semicolon should terminate a statement. And the statement would be the SELECT statement in total. Something like
select (if (DESCRIPTION= 'Stop save') then ('gddo') else ('turr') end if) as dep
from CIRC.TAG;
December 22, 2010 at 7:33 am
or with a case statement
select
CASE
WHEN DESCRIPTION= 'Stop save' then 'gddo'
ELSE 'turr'
END DEP
from CIRC.TAG
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply