197. Rising Temperature : Leetcode

오유찬·2025년 11월 25일

SQL

목록 보기
3/70

DATEDIFF(date1, date2) : 두 날짜 사이의 일수를 숫자로 표현하는 함수

# JOIN Condition에서 날짜차이가 1이 나도록 설정하여 테이블 결합
select * 
from Weather w1 INNER JOIN Weather w2
    on DATEDIFF(w1.recordDate, w2.recordDate) = 1;
answer
select w1.id
from Weather w1 INNER JOIN Weather w2
    on DATEDIFF(w1.recordDate, w2.recordDate) = 1
where w1.temperature > w2.temperature;
  }
profile
열심히 하면 재밌다

0개의 댓글