Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help with decode statement..

phani marellaSep 25 2007 — edited Sep 25 2007
Hi everyone,

I am trying to write a decode statement which has SELECT stament in it.
Is it possible to write a decode which has select statement in it.

EX

select Decode (some_id, select count(*) from table where condition,result,default_value)


what i am trying to do is ...if

select count(*) from table where condition returns 0 then i need 1 result and if it returns greater than 0 i need other result.
could some one give me an example to do that.

Thanks
phani
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2007
Added on Sep 25 2007
5 comments
721 views