I have a single table with this schema:
|code|time|fk|
--------------
|a |0.1 |2 |
|b |0.2 |1 |
|b |0.3 |2 |
And I would want to make compare all the codes and give me something like this:
|code|time_fk1|time_fk2|
------------------------
|a |null |0.1 |
|b |0.2 |0.3 |
sql: select code, time_fk1, time_fk2 from table2 as fk1 left join table2 as fk2 on fk1.code=fk2.code where (fk1.fk=1 or fk1.fk is null) and (fk2.fk=2 or fk2.fk is null)
The goal is a full outer join: but im not complicating to much yet because not even a left/right join works
But access gives me only this with that query:
|code|time_fk1|time_fk2|
------------------------
|b |0.2 |0.3 |
It acts exactly as it were a inner join! If I change the “left” in the above query for (right or inner the results are the same)
thanks
However, using this query b will come twice in the result if it has time against both fk’s.