Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Calculated Item which includes a sub query

Calculated Item which includes a sub query

From: The Chad <funkstylin_at_hotmail.com>
Date: Fri, 15 Aug 2003 12:41:37 +1000
Message-ID: <bhhh9g$pcu$1@seagoon.newcastle.edu.au>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US