Hi,
I have a complex SQL query that i cannot solve in access. I have a table, for example
john
james
sam
james
fred
harry
james
etc..
and i want to be able to define a SQL statement that will give a the top 5 most popular elements..i have a SQL statement
SELECT TOP 1 productID FROM orders GROUP BY productID ORDER BY count(productID) DESC
that will give me the most popular element but how do i get the sql statement to return the top 5. any ideas?
thanks for your time
jim
I have a complex SQL query that i cannot solve in access. I have a table, for example
john
james
sam
james
fred
harry
james
etc..
and i want to be able to define a SQL statement that will give a the top 5 most popular elements..i have a SQL statement
SELECT TOP 1 productID FROM orders GROUP BY productID ORDER BY count(productID) DESC
that will give me the most popular element but how do i get the sql statement to return the top 5. any ideas?
thanks for your time
jim