--注意HAVING里不支持别名
SELECT k001,k002,k003,k004,k005,COUNT(DISTINCT k006) cc FROM asis.gbno
WHERE k005 = '3' GROUP BY k001,k002,k003,k004,k005 HAVING COUNT( DISTINCT k006) > 1
Oracle having
最新推荐文章于 2023-04-12 21:07:58 发布
--注意HAVING里不支持别名
SELECT k001,k002,k003,k004,k005,COUNT(DISTINCT k006) cc FROM asis.gbno
WHERE k005 = '3' GROUP BY k001,k002,k003,k004,k005 HAVING COUNT( DISTINCT k006) > 1