Is there a MYSQL query I can use to order items from a second table.
My example
I’m listing My Stores… each store has a number of products in a diffrent table.
so my store listing displays the number of products in that store..
is there an easy MYSQL query so i can order my stores by number of products
my store doesnt hold a value of the number, it counts the rows in the 2nd table
If I understood your problem correctly, you may want to try something like the following:
Test case:
Result:
You can also sort in descending order by adding
DESCafterORDER BY num_products: