15.02.2011, 21:12
Yes there is a problem, that's why you should use LEFT JOIN here:
Don't know if your field which holds owner's ID in Houses table is named OwnerID, but I suppose so. This query will select owner's name (if ownerID is connected to any account ID), otherwise "virtual" field ownername will be NULL.
Quote:
SELECT gh.*, acc.Username AS ownername FROM Houses gh LEFT JOIN Accounts acc ON gh.OwnerID = acc.ID |