SQL 2-2일차

gyu·2021년 10월 24일
0

Sparta-SQL

목록 보기
5/11

정렬을 하고 싶을 땐 order by

주로 맨마지막에 써줌
-order by count() (asc)기본은 작은 것부터 나옴(오름차순)
-order by count(
) desc 내림차순

-group by 와 order by 같이 쓸 수도 같이 안쓸 수도 있음

실행순서

3)select name, count() 1)from users
2)group by name
4)order by count(
);

1) users 에서
2)name 으로 묶었고
3) name 과 count 를 출력했다
4) 정렬은 데이터를 다 뽑고 마지막에!

profile
#TechExplorer 🚀 Curious coder exploring the tech world, documenting my programming journey in a learning journal

0개의 댓글