▣ group by ( sum , min , max , count , avg )
페이지 정보
작성자 관리자 작성일 23-04-14 10:31 조회 637 댓글 0본문
▣ select * from notice;
① select writer,sum(hit) from notice group by writer; --writer 별 총 조회수
② select writer,min(hit) from notice group by writer; --writer 별 최저 조회수
③ select writer,max(hit) from notice group by writer; --writer 별 최고 조회수
④ select writer,avg(hit) from notice group by writer; --writer 별 총 조회수
⑤ select writer,count(*) from notice group by writer; --writer 별 총 작성수
⑥ select writer,count(*) from notice group by writer HAVING count(*) > 3; --group by 절에서 조건은 HAVING 이용
추천0 비추천 0
댓글목록 0
등록된 댓글이 없습니다.