>CLOSE all > >* create 2 dummy tables in current directory and add 2 records to each >* note: one record is different in the tables. >CREATE TABLE tbl1 (userid c(10)) >INSERT INTO tbl1 (userid) VALUES ("mark") >INSERT INTO tbl1 (userid) VALUES ("ed") > >CREATE TABLE tbl2 (userid c(10)) >INSERT INTO tbl2 (userid) VALUES ("john") >INSERT INTO tbl2 (userid) VALUES ("ed") > >* run query on our tables, which are not indexed. >* As expected, in VFP7, this will return 1 row. (the row that doesn't exist in tbl2). >* In VFP6 we get 0 rows. >SELECT tbl1.*; > FROM tbl1; > LEFT JOIN tbl2; > ON tbl1.userid = tbl2.userid; > WHERE ISNULL(tbl2.userid) > >* now run same query, but on indexed files. >* In VFP7, this will incorrectly return ALL rows. >* In VFP6 we get 0 rows. >SELECT tbl1 >INDEX ON userid TAG userid >SELECT tbl2 >INDEX ON userid tag userid > >SELECT tbl1.*; > FROM tbl1; > LEFT JOIN tbl2; > ON tbl1.userid = tbl2.userid; > WHERE ISNULL(tbl2.userid) > >* now run same query using the HAVING clause instead of the WHERE clause. >* This will return correct results, in VFP7 or VFP6, whether the file is indexed or not. >SELECT tbl1.*; > FROM tbl1; > LEFT JOIN tbl2; > ON tbl1.userid = tbl2.userid; > HAVING ISNULL(tbl2.userid) > >CLOSE ALL >DELETE FILE tbl1.* >DELETE FILE tbl2.*