April 24th, 2000, 02:12 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?
April 25th, 2000, 04:34 AM
Just try with following example:
select t1.prod_id, t2.prod_id, t1.name, t2.description, t2.price,t1.alreadysold,
from tblename1 as t1,tblename2 as t2,
where t1.prod_id = t2.prod_id
group by t1.alreadysold, t2.alreadysold limit 0,10;
[This message has been edited by Shiju Rajan (edited April 25, 2000).]
April 25th, 2000, 06:37 AM
Sorry, maybe i'm not clear enough. Every product has a unique prod_id. There is only one prod_id "1" in all the tables. That's the problem.
Any other sugestions?