|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
Just try with following example:
select t1.prod_id, t2.prod_id, t1.name, t2.description, t2.price,t1.alreadysold, t2.alreadysold from tblename1 as t1,tblename2 as t2, where t1.prod_id = t2.prod_id and t1.alreadysold='yes' and t2.alreadysold='yes' group by t1.alreadysold, t2.alreadysold limit 0,10; GOOD LUCK!! ------------------ SR - shiju.dreamcenter.net [This message has been edited by Shiju Rajan (edited April 25, 2000).] |
|
#3
|
|||
|
|||
|
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? Dave |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Getting query from different tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|