728x90
Having: Pandas 의 agg
select email from person
group by email
having count(email) > 1 ;
Having 절 출처: keep-cool.tistory.com/37
HAVING 절은 해석상 WHERE 절과 동일하다. 단 조건 내용에 그룹 함수를 포함하는 것만을 포함한다.
일반 조건은 WHERE 절에 기술하지만 그룹 함수를 포함한 조건은 HAVING 절에 기술한다.
having은 group by로 묶인 부분에 대해서 조건을 수행한다는 것.
Pandas 의 agg로 생각하면 된다.
728x90
'SQL' 카테고리의 다른 글
[LeetCode] Delete Duplicate Emails (delete, self join, and) (0) | 2021.04.09 |
---|---|
[LeetCode] Customes Who Never Order (is null, join) (0) | 2021.04.09 |
[LeetCode] Employees Earning More Than Their Managers (Self Join) (0) | 2021.04.08 |
[LeetCode] Second Highest Salary MySQL (0) | 2021.04.08 |
[MySQL] Code Snippets (0) | 2021.04.08 |
댓글