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

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

Re: SQl Query Help

From: jaromir nemec <jaromir_at_db-nemec.com>
Date: Sun, 1 May 2005 10:56:50 +0200
Message-ID: <010801c54e2b$b7dc3730$3c02a8c0@JARAWIN>


Hi,

you may wont to add some extra check in case that the day of birth column is nullable.

Regards

Jaromir
----- Original Message -----
From: "Sanjay Mishra" <smishra_97_at_yahoo.com> To: <Christian.Antognini_at_trivadis.com>
Cc: <oracle-l_at_freelists.org>
Sent: Friday, April 29, 2005 5:01 PM
Subject: RE: SQl Query Help

Thanks you very much Christian and this is what I am looking. This has given me the idea as how to use it in mine code

Thanks

Christian Antognini <Christian.Antognini_at_trivadis.com> wrote: Hi Sanjay

>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=20
>ignore all of those FatherId and ChildId.

To find the fathers a query like the following one should do the trick:

select fatherid
from a, b
where a.childid =3D b.childid
group by a.fatherid
having min(b.dob) >=3D to_date('01-JAN-04') and max(b.dob) <=3D = to_date('31-DEC-04')

HTH
Chris

--
http://www.freelists.org/webpage/oracle-l

__________________________________________________
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



--
http://www.freelists.org/webpage/oracle-l
Received on Sun May 01 2005 - 05:04:03 CDT

Original text of this message

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