[SQL문제풀기] 가장 큰 물고기 10마리 구하기(SELECT)

241227
이나겸's avatar
Dec 27, 2024
[SQL문제풀기] 가장 큰 물고기 10마리 구하기(SELECT)
Contents
Q.풀이

Q.

notion image
 

풀이

  • is not null
    • null이 아님
  • order by length desc, id asc
    • length 기준으로 내림차순, id 기준으로 오름차순
  • limit 10
    • 정렬된 결과 중 상위 10개의 행만 가져옴
select id, length from fish_info where length is not null order by length desc, id asc limit 10;
Share article

Nakyeom's Study