Fw: Query

From: "shreedhar" <shreedhar(at)lucidindia(dot)net>
To: "Postgre General" <pgsql-general(at)postgresql(dot)org>
Subject: Fw: Query
Date: 2003-03-31 07:24:24
Message-ID: 005e01c2f756$8e873930$1201a8c0@a4005
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

Another way of fetching result

SELECT * FROM tempemp WHERE salary IN ( SELECT MAX(Salary) FROM tempemp WHERE deptid IN ( SELECT MAX( deptid) FROM tempemp GROUP BY deptid ));

Regards,

Hi All,

table consists of following data

empname deptid salary

xx 1 10000
xx1 2 5000
xx2 1 20000
xx3 1 10000
xx4 3 50000
xx5 4 10000

Can any body give Query to retreive employ name from department with maximum employee who is getting maximum salary.

expected result :

empname: xx2

Thanks And Regards,
Sreedhar

Browse pgsql-general by date

  From Date Subject
Next Message mark carew 2003-03-31 08:38:24 Re: Any recommendations for books on PostgreSQL?
Previous Message Paul Rosenberg 2003-03-31 04:11:42 Re: Reverse engineering PG database