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

Home -> Community -> Usenet -> c.d.o.misc -> need help with this query

need help with this query

From: Dominick Logiudice <dlogiudice_at_pine.vpcc.sunysb.edu>
Date: Thu, 19 Nov 1998 12:25:19 -0500
Message-ID: <3654547F.5BEC79E1@pine.vpcc.sunysb.edu>


I have db with timesheets db looks like this SSNO,AGENCY,ACCTNO,PAYNO,TIME_PAYNO,BEGINDATE,ENDDATE The person could have multiple timesheets and agency can be 1 or 3.
We want the distinct ssn ,agency,min(begin_date) where the payno = '817'
So if a person was there like this:

ssn		agency  	begindate payno
111111111	1		09/01/98   817
111111111	1		09/10/98   817	
111111111	3		09/02/98   817
111111111	3		09/15/98   817

I looking for this as my answer 
ssn		agency  	begindate payno
111111111	1		09/01/98   817
111111111	3		09/02/98   817

Using this query
select distinct ssno,ageny from timedb
where payno = '817'
order by ssno,payno
I get these results, but when I can't get the min(begindate)

ssn		agency 
111111111	1	
111111111	3	

Any Idea's Received on Thu Nov 19 1998 - 11:25:19 CST

Original text of this message

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