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


(rest_branches) table of restaurants.

(phone_numbers) table contains restaurants phone_numbers, , has field called (branch_id) references restaurant id.

when try:

select *  rest_branches natural join phone_numbers 

i restaurants have phone_number. should restaurants if don't have phone number?

because that's how inner/natural joins work. if wanted restaurants, use left join instead , specify join condition.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -