>I have a select statement with a join condition that looks like this:
>
>
>SELECT a.acct_nbr, a.holder_num, b.h_name ;
> FROM tmpCD a ;
> LEFT JOIN holders b ON a.holder_num = b.h_num ;
> INTO cursor tmpCursor
>
>
>The tmpCD file has about 1.25 million records. After running the select, the resulting cursor has 6 records more than the original tmpCD file....seems like it should be the same record count. None of the holder_num fields are empty. What am I missing here?
You'll get extra records in the result cursor if you have values in column tmpcd.holder_num that are not present in holders.h_num, not just if they are blank. You can pinpoint these records with
SELECT a.acct_nbr, a.holder_num ;
FROM tmpCD a ;
WHERE a.holder_num NOT IN (SELECT b.h_num FROM holders b) ;
INTO CURSOR Orphans
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up