Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql select problem
Message
 
 
To
12/08/2008 12:35:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01338358
Message ID:
01338364
Views:
12
>I have a table named tb_quotedetail. Inside this table i have 4 fields. F1) IDMASTER (n) F2) ORIGINID (n) F3)DESTINATIONID (n) F4)PRODUCTID(n)
>origin and destination id are associated with the autoid in the table tb_city. and product id is associated with the autoid of tb_product.
>So i want to do a select in tb_quotedetail where the id master is 11 and i want the product name , city origin name and city destination name. how can i do it, thanks
select Ci1.City as CityOriginaName, Ci2.City as DestinationName, P.ProductName 
from Tb_QuoteDetail T 
INNER JOIN Tb_City Ci1 on T.OriginID = Ci.AutoID ;
INNER JOIN Tb_City Ci2 on T.DestinationID = Ci.AutoID ;
INNER JOIN tb_Product P on T.ProductID = P.AutoID where T.MasterID = 11
Something like that.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform