nix, shell, perl, php, mysql and mac os x tips and tricks

Wednesday, October 22, 2003

Select most popular items in MySQL

SELECT count( unoptioned_skuid ) as count , unoptioned_skuid as skuid
FROM orders_products
GROUP  BY unoptioned_skuid 
ORDER BY count DESC

No comments:

Post a Comment