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!

Code help

varunJan 31 2011 — edited Jan 31 2011
Output for the given code is in the url below. Each ACCOUNT is repeated twice. Now i want to change the code so that the difference between EDATE is 90 days for the same ACCOUNT( for example ACCOUNT = 10002961, difference between 10/27/2010 and 11/22/2010).Display only the one's with difference 90.
select 

  b.ACCOUNT ACCOUNT
, Trunc (a.ENTRY_DATE) EDate


from  CIRC.SUBS_TAG a, CIRC.TAG c, DSIPROC.TRB_SUBS_INFO b

join

   (
    select b.ACCOUNT 
    from  CIRC.SUBS_TAG a, DSIPROC.TRB_SUBS_INFO b, CIRC.TAG c
    where a.ACCOUNT= b.ACCOUNT and a.CODE=c.CODE
    group by b.account
    having count(1) >1
   ) z on z.account = b.account


where a.ACCOUNT= b.ACCOUNT and a.CODE=c.CODE   

order by b.account, a.entry_date
[http://img153.imageshack.us/i/image1he.png/]
This post has been answered by Frank Kulash on Jan 31 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2011
Added on Jan 31 2011
4 comments
26 views