Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with my SQL-SELECT
Message
De
27/04/2003 10:32:06
 
 
À
27/04/2003 10:27:16
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00781951
Message ID:
00781954
Vues:
24
This message has been marked as the solution to the initial question of the thread.
>Denis
>
>You either have multiple products with the same code in the produit table or there are multiple price records for each product code in the produit_prix table.
>
>If there are products without corresponding produit_prix records, you can only use outer joins. An inner join would not return such records.
>
>>Here's what I entered to create a cursor for a report
>>
>>select produit.code, produit.nom, produit_prix.prix_achat, produit.stoc;
>>from produit;
>>left outer join produit_prix on produit.code = produit_prix.cod;
>>where produit.produit = 1;
>>order by produit.code
>>
>>But certain items are doubled others tripled.
>>
>>What I want to do is to get prices for some products. Some products don't have prices defined yet (inner join is needed).
>>
>>Why would I have those results?

I just made a typo. Should have said outer join in my description after the SQL definition.

But after looking again I found out that some products have more than 1 price.

Thx for the help Mike.
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform