Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Calculated Item which includes a sub query
Hi
In Cognos reports I often create items which use IF-THEN-ELSE logic and
include a sub query.
e.g. IF (employee# in (Dataset)) THEN 'Good' ELSE 'Bad' .... where Dataset
relates to another report where employee# is returned.
Now I want to do the same kind of thing in Oracle SQL.
I thought using the DECODE function may have worked, but it doesnt seem to
allow a subquery to be used inside it.
e.g. decode (employee#, (select employee#, perform_review from employee
where award = 'GEN'), TO_CHAR(perform_review), 'not found') AWARD
So, if the employee# is found in the subquery, return the corressponding
date (perform_review field) or else return the text 'not found'.
Any ideas how I can build this kind of item in Oracle SQL ?
cheers
Chad Received on Thu Aug 14 2003 - 21:41:37 CDT
![]() |
![]() |