You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
결과는 평균점수를 기준으로 내림차순 정렬하고, 평균점수가 같다면 즐겨찾기수를 기준으로 내림차순 정렬한다.
💬 풀이
SELECTri.REST_ID, ri.REST_NAME, ri.FOOD_TYPE, ri.FAVORITES, ri.ADDRESS, ROUND(AVG(rr.REVIEW_SCORE), 2) AS SCORE
FROM REST_INFO AS ri INNER JOIN REST_REVIEW AS rr
ONri.REST_ID=rr.REST_IDWHEREri.ADDRESSLIKE"서울%"GROUP BYri.REST_IDORDER BY SCORE DESC, ri.FAVORITESDESC
💬 알게된 문법
✅ ORDER BY 우선순위 부여
정렬 우선순위가 높은 것부터 기재해준다.
✅ 평균값 구하기 (AVG)
AVG(컬럼명)
✅ 반올림 하기 (ROUND)
ROUND(값, 자릿수)
The text was updated successfully, but these errors were encountered:
💬 문제
https://school.programmers.co.kr/learn/courses/30/lessons/13111
💬 Idea
💬 풀이
💬 알게된 문법
✅ ORDER BY 우선순위 부여
✅ 평균값 구하기 (AVG)
✅ 반올림 하기 (ROUND)
The text was updated successfully, but these errors were encountered: