nicklaspet
Programmer
I have found that the folowing query gives the wrong result in number of hits, because its a LEFT JOIN it should return all rows from Table1 but does only return a subset, it seems that the Access engine makes the second condition in the Join condition a where condition instead of a condition for the Join!
SELECT DISTINCT
A.ID,
B.ID
FROM Table1 AS A
LEFT JOIN Table2 AS B ON (A.ID=B.IDX And B.Number=9)
On other SQL engines ad for example(MSSql 6.5, 7.0, and 2000) the Join condition is used correctly.
I have found another way to write the query so that it returns the correct result, works find with about 10 rows in the table but it takes about 40 minutes to return 5000 rows so I dont think I want to use that way, though here it is if it helps..
SELECT DISTINCT
A.ID,
B.ID
FROM Table1 AS A
LEFT JOIN Table2 AS B ON (1 = 0) OR (A.ID=B.IDX And B.Number=9)
Doesnt quite understand whats happening inside the Access engine but probably the second query joins all tables from the Table2 to each row into Table1 and then filters among them, that would explain the time factor
Is there any other way to write the query so that is will work, with good performance ?
SELECT DISTINCT
A.ID,
B.ID
FROM Table1 AS A
LEFT JOIN Table2 AS B ON (A.ID=B.IDX And B.Number=9)
On other SQL engines ad for example(MSSql 6.5, 7.0, and 2000) the Join condition is used correctly.
I have found another way to write the query so that it returns the correct result, works find with about 10 rows in the table but it takes about 40 minutes to return 5000 rows so I dont think I want to use that way, though here it is if it helps..
SELECT DISTINCT
A.ID,
B.ID
FROM Table1 AS A
LEFT JOIN Table2 AS B ON (1 = 0) OR (A.ID=B.IDX And B.Number=9)
Doesnt quite understand whats happening inside the Access engine but probably the second query joins all tables from the Table2 to each row into Table1 and then filters among them, that would explain the time factor
Is there any other way to write the query so that is will work, with good performance ?