Leetcode PHP题解--D27 620. Not Boring Movies


620. Not Boring Movies

题目链接

620. Not Boring Movies

题目分析

前面铺垫了那么多,要求就在这:

movies with an odd numbered ID and a description that is not 'boring'. Order the result by rating.

返回id为偶数、description不是boring的结果,并且按rating排序。

思路

返回偶数id的结果,这个比较简单,除以2去余就好了:id%2=1

description不能是boring,也很简单description not like 'boring'

根据rating排序:order by rating

最终代码

# Write your MySQL query statement below
SELECT * FROM cinema WHERE id%2=1 AND description NOT LIKE 'boring' ORDER BY rating DESC;

若觉得本文章对你有用,欢迎用爱发电资助。


Vote Vote Cancel Collect Collect Cancel

<< 上一篇: Leetcode PHP题解--D26 766. Toeplitz Matrix

>> 下一篇: Leetcode之PHP版题目解析(9. Palindrome Number)