I am looking for a SQL command that allows me to list for example the top 2
or 3 values for each category. for example I have a table with names, town,
salary. I want the names of the two people who have the highest salaries in
each town. Imagine the towns are Liverpool, Southport, London. the result
of query should give me two names for each town and the names, towns and
salaries must be listed. The listed names must be those who get the highest
salaries in each town. Looked in every book but not found it. I found a Top
command but didn't give me the correct results. Hope someone can help.
Thanks
or 3 values for each category. for example I have a table with names, town,
salary. I want the names of the two people who have the highest salaries in
each town. Imagine the towns are Liverpool, Southport, London. the result
of query should give me two names for each town and the names, towns and
salaries must be listed. The listed names must be those who get the highest
salaries in each town. Looked in every book but not found it. I found a Top
command but didn't give me the correct results. Hope someone can help.
Thanks
Comment