我有以下查询:
SELECT address.addressid,
employee.employeeid
FROM employee,
address
WHERE address.employeeid = employee.employeeid;
产生以下输出:
现在我想限制行,说只有两个以上地址的员工才会被查询显示。我如何实现这一目标?
答案 0 :(得分:0)
select address.addressid,
employee.employeeid
from employee,
address
where address.employeeid = employee.employeeid
group by employee.employeeid
having count(address.employeeid) > 2