HI
i am learning SQL with Mosh now.
for the course : Correlated Subqueries, there is one making me confused.
requirements:
–Get invoices that are larger than the
– Client’s average invoice amount.
the coding:
USE sql_invoicing;
select *
from invoices i
where invoice_total > (
select AVG(invoice_total)
from invoices
where client_id = i.client_id
My question:
How to understand the last line? why shall give alliance without connecting two tables?
By the way
is there any living exchange chatting group recommend?
thank you very much.
BR
Jingni