Forum Moderators: open
I'm using Inner Join to pull data out of a second table, but I want a row even where the "ON" is not matched, eg the query looks something like:-
SELECT name, age, table2.job FROM table1
INNER JOIN
table2 ON name = surname
ORDER BY DateTime DESC
LIMIT 5;
Basically I want a row returned even where name <> surname and in that case I want name to be displayed as "NULL".
Any thoughts?
Thanks,
TJ
The other way is to have a dummy record in the master table and set a default value in the child table to point to the dummy. That keeps the db using all inner joins but might not be appropriate for your appp.