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

Home -> Community -> Mailing Lists -> Oracle-L -> SQl Query Help

SQl Query Help

From: Sanjay Mishra <smishra_97_at_yahoo.com>
Date: Thu, 28 Apr 2005 18:44:32 -0700 (PDT)
Message-ID: <20050429014432.40628.qmail@web51304.mail.yahoo.com>


Hi  

I am looking one query help and below is scenario  

Table A contains
  FatherId
  ChildId  

A Father can have several Children  

Table B contains
  ChildId
   DateOfBirth  

Now I need the output as
Fatherid and its ChildId only and only if all of it Child are born in some TimeFrame. If any of the Child is born out of this TimeFrame then it will ignore all of those FatherId and ChildId.  

e.g
TableA
FatherId ChildId

1               1,2,3,
 2              8,9,10
3               11,12
 
TableB
ChildId           DOB
1                    jan 03
2                     Jul 04
3                     Aug 05
8                     Jan03
9                      Jan 04
10                     jan 05
11                      Feb 04
12                     Dec 04
 

Now I am looking TimeFrame of Jan1 04 to Dec 31 04 So it should display only

FatherId          ChildId  DOB
3                   11,12      Feb04 and Dec 04
 

As all other Father 1 and 2 have some child born in 03 or 05  

Thanks for your help      



Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Apr 28 2005 - 21:49:16 CDT

Original text of this message

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