Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> need help with this query
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