April 24th, 2000, 02:47 PM
I have different tables with product. Every tables is a different category, and has prod_id, name, description, price and already sold(int, how many already sold). I want to make a top 10 most sold products.
For this is have to make a query from different tables, sort by 'already sold' and limit to 10, but how to do this?
This all in mySQL/PHP3.
April 25th, 2000, 04:38 AM
use a join stmnt in your sql query.
April 25th, 2000, 06:39 AM
Every product has a unique prod_id. There is only one prod_id "1" in all the tables. That's the problem. How do I then use a join statement?
Any other sugestions?
April 25th, 2000, 05:11 PM
select distinct product_sales_count.product_id, product_mstr.product_description from product_sales_count, product_mstr where product_sales_count.product_id = product_mstr.productid order by product_sales_count.quantity limit 0,30
Ulysses J Ludwig