(SELECT * FROM customer_usa INTERSECT SELECT * FROM customer_gt_90_dollars ) SELECT e.first_name || " " || e.last_name employee_name, COUNT(u90.customer_id) customers_usa_gt_90 FROM employee e LEFT JOIN usa_gt_90 u90 ON u90.support_rep_id = e.employee_id WHERE e.title = "Sales Support Agent" GROUP BY 1 ORDER BY 1;
What I expected to happen:
I was expecting an error because I was about using
WHERE on a virtual table generated by the
GROUP BY clause.
What actually happened:
There was no ERROR!
Please I need more insight on the use of
Thanks in advance.