I a table "person" and need a query for those personName who's
1.salary is maximum
2.cityCode is 12
3. age is 32
suppose- there are 3 person with name RAM .
AND 3 with name sunil
and 3 person with name rahul....
and i need the only those record who contain the maximum salary
means ram with maximum salary , sunil with maximum salary and rahul with maximum salary
Sql querry
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Iftikar HussainRank #423 · 5.9K reputationPosted Jul 9, 2013, 10:05 PM EDT
try like this
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 9, 2013, 10:06 PM EDT
SELECT DISTINCT Name, Salary FROM EMP WHERE
Salary = (SELECT Max(Salary) FROM EMP) And CityCode=12 and Age=32