myflashstore
Programmer
Hi,
I have a table full of purchased items and i want to be able to select the top 10 most purchased products for a given user and I want to return the ID of those along with how many instances of that ID exists.
I'm using the following SQL code
SELECT TOP (10) beat_id, Count(*)
FROM jos_mfs_items
WHERE producer = 100
GROUP BY beat_id
ORDER BY COUNT(*) DESC
But it doesn't return anything, does anyone have any clues why?
Thanks
I have a table full of purchased items and i want to be able to select the top 10 most purchased products for a given user and I want to return the ID of those along with how many instances of that ID exists.
I'm using the following SQL code
SELECT TOP (10) beat_id, Count(*)
FROM jos_mfs_items
WHERE producer = 100
GROUP BY beat_id
ORDER BY COUNT(*) DESC
But it doesn't return anything, does anyone have any clues why?
Thanks