I’ve got a little problem, I’m stuck with. I got two tables. The first one holds all id’s, the second one some, but not all from tableA, a value and a corresponding identifier. As I thought I had it understood, a left join on the id’s should give me all id’s in the first table and null for the second, if the id doesn’t exist in tableB. But I keep getting the number of id’s that exist in both tables. Did I get the concept wrong?
My statement so far is:
SELECT tableA.id, tableB.desiredValue
FROM tableA
LEFT JOIN tableB ON tableA.id=tableB.item_id
WHERE tableB.element_id = 'something'
OR tableB.element_id IS NULL;
Any pointers?
Thanx, best regards,
Marcus
Move the condition that involves
tableBcolumn fromWHEREtoON: