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;

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

    原文作者:skys215
    原文地址: https://www.jianshu.com/p/a5085c6fcd95
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞