티스토리 뷰

공부

[SQL] groupBy & having?

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

[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;


728x90

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

[DP] changeCoin?  (0) 2018.09.08
[Greedy] jewelryThief - priority_queue(heap)  (0) 2018.09.08
[SQL] groupBy & having?  (0) 2018.09.08
[SQL] join?  (0) 2018.09.08
[SQL] where & orderBy & limit  (0) 2018.09.08
[Math] changeProposition?  (0) 2018.09.08
댓글
댓글쓰기 폼