MySQL Forums
Forum List  »  Newbie

Re: Creating view, showing only data whithout connceted data
Posted by: Peter Brawley
Date: July 30, 2020 04:22PM

If each order gets one report, then the object table foreign key should reference the order table, And you'd write ..

select ...
from object
join order using(objectid)
left join report using(orderid)
where report.orderid is null;

Those last two lines implement an exclusion join. Read about 'em.

Options: ReplyQuote


Subject
Written By
Posted
Re: Creating view, showing only data whithout connceted data
July 30, 2020 04:22PM


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.