Skip to content
Advertisement

Select a value from Table 2 that depends on another value from Table 1 (Oracle SQL)

I’m trying to do some DB during the lockdown and would appreciate some help, since I have been doing this for 5 hours without luck. Got a PDF from a book and sadly, the solutions part isn’t readable.

Here are two tables:

The activity requests that I create an “SQL statement that selects all bags names and their buyer name (so 2 columns only), and to show null values as well” because Mac doesn’t have a buyer.

I have been trying JOIN and UNION, but no lock.

Thank you very much

Advertisement

Answer

You need an OUTER JOIN:

Demo:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement