Skip to content
Advertisement

How to use WHERE EXISTS in a SQL subquery?

I need to find the distinct drinkers who have ordered drinks at a pub on VICTORIA AVE. in March 2020.

Here are the tables I am trying to retrieve data from:

Here is my SELECT statement so far:

Advertisement

Answer

The subquery needs to be correlated to the main query in its WHERE clause.

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