Two approaches come to my mind. First is to order by salaray and take the next row. Limit the number of rows output, database permitting. Second using subquery, which definately is not the most efficient way, but allows this to be done with a single query.
Ayub ali khan
posted 12 years ago
Thanks Jussi!! Could you metion the query for the first approach?