Home » SQL & PL/SQL » SQL & PL/SQL » Multiple rows SQL query
Multiple rows SQL query [message #38565] Fri, 26 April 2002 20:00 Go to next message
supreme
Messages: 2
Registered: April 2002
Junior Member
I have multiple rows of employees with multiple dates duplicating the rows with same names with multiple dates.
I need all employees names without including the date in select statement, but the latest record for each of them.
Re: Multiple rows SQL query [message #38567 is a reply to message #38565] Fri, 26 April 2002 20:40 Go to previous messageGo to next message
Saga
Messages: 51
Registered: April 2002
Member

Lets suppose i need to select all the records from emp table for the maximum salary group by deptno...
My query will be as under:-

SELECT d.* FROM EMP d WHERE sal = (SELECT MAX(sal) FROM EMP WHERE deptno = d.deptno)

It makes use of Correlated query.
Hope it helps.
Re: Multiple rows SQL query [message #38575 is a reply to message #38565] Sat, 27 April 2002 21:28 Go to previous message
Vikas Gupta
Messages: 115
Registered: February 2002
Senior Member
I could not get your query. Whats the use
of getting the empno without max dates ?
I can u give some sample of data and result
u require .....
Previous Topic: Identifying Rollback Segment for a transaction
Next Topic: i'm looking to know about exceptions
Goto Forum:
  


Current Time: Thu Apr 25 09:57:08 CDT 2024