Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with my SQL-SELECT
Message
From
27/04/2003 10:32:06
 
 
To
27/04/2003 10:27:16
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00781951
Message ID:
00781954
Views:
22
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é
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform