HDFilmMaker2112 Posted June 10, 2011 Share Posted June 10, 2011 I'm looking to know how to tweak this query so it finds the one category with the fewest products in it. mysql_fetch_array(mysql_query("SELECT COUNT(product_id) AS num FROM products")); Quote Link to comment Share on other sites More sharing options...
HDFilmMaker2112 Posted June 10, 2011 Author Share Posted June 10, 2011 I basically need something like this: mysql_fetch_array(mysql_query("SELECT COUNT(product_id) AS num FROM products WHERE product_cat=(SELECT product_cat FROM products WITH LEAST SUM(product_id))")); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.