sql统计分组数
sql统计分组的组数
列1:
SELECT COUNT(*) from (SELECT * from enroll GROUP BY org_id) newtable;
列2:
SELECT COUNT(0) FROM(SELECT member_id from li_store_flow WHERE(
create_time BETWEEN '2022-06-01 00:00:00.0' AND '2022-07-06 23:59:59.999'
) GROUP BY member_id) newtable
SELECT
例子
查询攻击的类别数
SELECT
"count" (*)
FROM
( SELECT event_type FROM internal_app_bsackc."event"
GROUP BY event_type ) AS a;