When I left join two tables like this:
SELECT * FROM a LEFT JOIN b ON a.id = b.id
It is not really empty. That is just how the results are interpreted by the tool you are using. You see, the problem is that the result set has two columns called
id, so one is arbitrarily chosen -- and it doesn't seem to be the one you want.
The simplest method is to switch to a
SELECT * FROM a LEFT JOIN b USING (id);
id only once in the result set and it should have the value in the first table (in this case).