Hi all I have 3 tables im pretty sure I need data from to achieve a top ten selling items in a certain category if possible I would greatly appreciate some assistance, comments and or solution. Heres the table structures product [table] ************* productID name catID price approved Which is related to: sold [table] ****** productID total [total sold] and category [table] ****** catID catDesc parentID What Im attempting is to get the Top Ten products sold from a certain category then duplicating the file and simply change the catID in the query to get multiple blocks on my site to display Top Ten for several categories. Any help would be greatly appreciated. Thanks regards MASsIVE
it would be something like this select sum(total),name,p.productID from product p inner join sold s on p.productID= s.productID group by p.productID order by sum(total) desc limit 10; Good luck