I need this query:
SELECT ItemID, Price
FROM table
WHERE ItemID = %d
GROUP BY Price
ORDER BY COUNT(*) DESC LIMIT 1
-run once a day, and have the results from it stored in another table with the time stamp of the query.
Is there a way I can automatically query all the available ItemID values? For example, if there are 20 ItemID values available, I need 20 separate queries.