Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT-SQL
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SELECT-SQL
Miscellaneous
Thread ID:
00491132
Message ID:
00491132
Views:
47
I have this code:

SELECT nDebit1.*, companyid.bankname AS bank ;
FROM nDebit1 LEFT OUTER JOIN companyid ;
ON ALLTRIM(nDebit1.companyid) = ALLTRIM(companyid.companyid) ;
AND (nDebit1.bankname!= "KEY" OR nDebit1.bankname!="UMB" ;
OR nDebit1.bankname!="ZIONS" ) ;
ORDER BY nDebit1.bankname ;
INTO TABLE ndebit2

I am trying to get the a table with the resulting bank name from the compnayid table but don't want all since companyid.companyid can be the same for some banks.

nDebit1.dbf has 242 records in it. The nDebit2.DBF result ends up with 196 records. When I use the LEFT OUTER JOIN in some cases I get the same number of records I start with. In this case, I get less records. Is this a glitch in VFP?
Even if I take the "AND" portion out of the "ON" I still get the same results. The help says I should get all of the records in the left table. Any idea what is happening here?


Thanks in advance for your help.
Randall
Thanks in advance for your help! :-)
Randall L. Johnson
Next
Reply
Map
View

Click here to load this message in the networking platform