使用 HAVING 子句筛选组
HAVING 子句删除不满足条件的组:
SELECT type, count(*) as c
FROM sys.objects
GROUP BY type
HAVING count(*) < 10
类型 | C |
---|---|
SQ |
3 |
PK |
1 |
U |
五 |
HAVING 子句删除不满足条件的组:
SELECT type, count(*) as c
FROM sys.objects
GROUP BY type
HAVING count(*) < 10
类型 | C |
---|---|
SQ |
3 |
PK |
1 |
U |
五 |