Why can't I SELECT a parent field that doesn't have a child?

Posted by myaccount on Stack Overflow See other posts from Stack Overflow or by myaccount
Published on 2010-04-28T10:39:14Z Indexed on 2010/04/28 10:43 UTC
Read the original article Hit count: 131

Filed under:
|
|
|
|

(rest_branches) is the table of restaurants.

(phone_numbers) is another table which contains the restaurants phone_numbers, and it has a field called (branch_id) which references the restaurant id.

When I try:

SELECT * 
FROM rest_branches
NATURAL JOIN phone_numbers

I only get the restaurants which have a phone_number. What should I do to get all restaurants even if they don't have a phone number?

© Stack Overflow or respective owner

Related posts about select

Related posts about parent