Skip to Main Content

Analytics Software

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!

EXISTS / NOT EXISTS

650380Jul 17 2013 — edited Jul 17 2013

Hi everybody,

just a quick question. What might be a way or the best way to realize the following SQLs with ODI (11.1.1.7).

It seems that SQLs with EXISTS / NOT EXISTS are unexpectedly hard to realize.

--Q1

SELECT a.*

  FROM tab_a a WHERE EXISTS (

       SELECT 1 FROM tab_b b WHERE a.x_id = b.x_id)

   AND a.cdate <= to_date('2012-03-01','YYYY-MM-DD')

   AND ( a.mdate IS NULL

       OR a.mdate >= to_date('2012-03-01','YYYY-MM-DD'));

       

--Q2

SELECT a.*, 'X' dataflag

  FROM tab_a a WHERE NOT EXISTS (

       SELECT 1 FROM tab_b b WHERE a.x_id = b.x_id

          AND b.mdate IS NULL )

  AND a.logicflag <> 'Y';

Regards,

Jens

This post has been answered by DecaXD on Jul 17 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2013
Added on Jul 17 2013
4 comments
1,324 views