Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JOIN vs WHERE
Message
From
17/06/2009 15:00:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/06/2009 14:24:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01406428
Message ID:
01406703
Views:
55
>>>Please Note: VFP 8
>>>
>>
>>PS: Both queries should return wrong count but I don't know what you really want to count (couldn't visualize).
>>
>>Maybe this one:
>>
SELECT  cust.customer, COUNT(fr.custshipm) ;
>>   FROM crsAllCust cust;
>>      LEFT JOIN crsFillRate fr ON cust.customer = fr.custshipm AND EMPTY(fr.PartOrders);
>>   GROUP BY cust.customer
>>
>>Cetin
>
>The original query actually had COUNT(fr.custshipm). I tested with COUNT(*) and got the same results. And that was the code I cut and pasted. I also tried it with COUNT(*) and COUNT(fr.custshipm) and both fields had the same values.

I think it was a coincidence having the same results. Count(*) should return 1 for no match on right side and that is not right. Count(fr.custshipm) should be the right SQL.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform