Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql select problem
Message
 
 
À
12/08/2008 12:35:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01338358
Message ID:
01338364
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform