当使用聚合函数时,出现在select中的字段要么出现在聚合函数里,要么出现在group by 子句里。像下面这句是错误的:1SELECT detno,AVG(sal),job FROM emp GROUP BY detno正确应该这么写:1SELECT detno,AVG(sal),job FROM emp GROUP BY detno,jobwhere 和 having的区别