我只想知道这个查询的内部执行,尤其是子查询中的值是如何被使用的
SELECT bu, location FROM
(
SELECT DISTINCT bu, hqname, location FROM DOCTOR
UNION
SELECT DISTINCT bu, hqname, location FROM CHEMIST
UNION
SELECT DISTINCT bu, hqname, location FROM STOCKIST
)
GROUP BY bu, location
HAVING COUNT (DISTINCT hqname) > 1;