Unanswered: SQL Query to Return Top 50 Companies in Each City
Microsoft Access 2007
I have a table that had different cities, companies within each city, and the gross profit of each company.
I'm trying to write a sql query that will return the companies with the top 50 profits in each city. So the output will show 50 records for each city sorted by the company with the highest profit to the company with the 50th highest profit.
I started trying to write a query and I figured I would need a subquery. I have some experience in sql in Oracle SQL Developer but I'm having trouble understanding the Microsoft Access sql syntax (I've been using some articles on msdn.microsoft.com).
If anyone could give my some starting points or links to good subquery articles that'd be great.
So far I have:
(SELECT * FROM Cities ORDER BY Gross Profit)
ORDER BY Cities, Gross Profit;
I think I'm primarily having trouble with the WHERE clause and how to specify 50.