Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> SQl Query Help
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
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Apr 28 2005 - 21:49:16 CDT
![]() |
![]() |