단순한 group by 절을 통해 한 컬럼의 그룹에 대한 개수를 구할 수 있다
SELECT mem_id, count(*)
FROM member
GROUP BY mem_id
count내에 조건을 설정하여 해당 조건에 따른 개수를 구할 수 있다
-- count(case when 조건 then 결과 end) as '별칭'
SELECT count(case when del=0 then mem_id end)
FROM member
count ~ distinct를 활용하여 중복값을 제거한 개수를 구할 수 있다
SELECT count(distinct mem_id) as mem_cnt
FROM member
https://codingspooning.tistory.com/entry/MySQL-count-%EC%A1%B0%EA%B1%B4-%EB%B0%A9%EB%B2%95