티스토리 뷰

공부

[SQL] groupBy & having?

seunggabi 승가비 2018. 9. 8. 19:20

[SQL] groupBy & having?


// GroupBy & Having & OrderBy

SELECT b.dept_name AS dept_name, COUNT(dept_name) AS count
FROM a RIGHT OUTER JOIN b
WHERE a.dept_id = b.dept_id
HAVING COUNT(dept_name) < 5
ORDER BY count;


'공부' 카테고리의 다른 글

[Rule] 보이스카우트 규칙  (0) 2018.09.24
[Ubuntu] Linux terminal process without kill after logout  (0) 2018.09.12
[SQL] groupBy & having?  (0) 2018.09.08
[SQL] join?  (0) 2018.09.08
[SQL] where & orderBy & limit  (0) 2018.09.08
[DB] 트랜잭션(작성중)  (0) 2018.08.27
댓글
댓글쓰기 폼