Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement
Message
De
08/11/2001 15:09:00
 
 
À
08/11/2001 14:59:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00579319
Message ID:
00579327
Vues:
27
>I am trying to do a select from 2 related tables in a one to many relationship. The first table holds orders and the second holds products. I would like to select all orders from the first table only if a certian product does not show up on that order in the second table. The products table can hold many diffetent products for each order, can a single select statement be made to weed out any orders that may contain a specific product? I usually do this with a select on the order table, then scan through the results with selects to the products table and then scan through those results to flag orders that may contain a certian product.
>
>Any help is greatly appeciated
>
>TIA
SELECT Orders.* ;
    FROM Orders ;
    WHERE OrderID NOT IN (SELECT DISTINCT Product.OrderID ;
        FROM Product ;
        WHERE Product.Name = cWeDontWantThisProduct)
Jay
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform