MySQL Forums
Forum List  »  Newbie

Re: Foreign Keys as first class citizens at design time?
Posted by: Phillip Ward
Date: August 13, 2015 06:28AM

Quote

... implicit join ...
To what, exactly?

Your example has only a simple, Parent-Child relationship.
Most databases have far more than one child table, so which table(s) would you implicitly join to? You certainly don't want to implicitly join across every child table, because
(a) that's going to be hideously inefficient if you don't actually need any data from those other tables and
(b) MySQL only allows for 61(?) tables in a "join" anyway. More than that and "Boom!".

I don't see why this doesn't do what you want:

SELECT  directory_name 
FROM       table1  t1 
LEFT JOIN  table2  t2 
     ON    t1.data_field = t2.key_field 
WHERE  t2.key_field IS NULL

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: Foreign Keys as first class citizens at design time?
August 13, 2015 06:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.