Witam, dzien 4 nauki sql
moje zadanie:
Show all books with their movie adaptations. Select each book's title, the name of its publishing house, the title of its adaptation, and the type of the adaptation. Keep the rows with no adaptation in the result.
moje rozwiazanie;
SELECT
book.title,
book.publishing_house,
adaptation.title
adaptation.type
FROM book
LEFT JOIN adaptation
on book.id = adaptation.book_id
WHERE adaptation.type = 'movie';
Moje pytanie:
Moze mi ktos logicznie wytlumaczyc dlaczego brakuje na koncu OR type IS NULL;
- wiadomo, ze odnosi sie to do "Keep the rows with no adaptation in the result".
Lecz czy wlasnie nie po to uzylem LEFT JOIN
a? zeby pozycje z null
tez wyswietlic?
Pozdrawiam wszystkich !