LeetCode - 620. Not Boring Movies (MySQL)

조민수·2024년 6월 11일
0

LeetCode

목록 보기
31/61

Easy, SQL - MOD()

RunTime : 234 ms


문제

Write a solution to report the movies with an odd-numbered ID and a description that is not "boring".

Return the result table ordered by rating in descending order.

The result format is in the following example.


풀이

  • 홀수인 id를 찾는 과정에서 MOD를 사용했다.
    • 나눈 나머지를 리턴해준다
SELECT * FROM Cinema
WHERE MOD(id, 2) = 1 AND description != 'boring'
ORDER BY rating DESC
profile
사람을 좋아하는 Front-End 개발자

0개의 댓글