leetcode 620. Not Boring Movies 用where语句判断

https://leetcode.com/problems/not-boring-movies/description/

 

不管题目简不简单,现在先熟悉语法。

直接用where语句判断即可,判断奇偶可以用 % 

# Write your MySQL query statement below
select *
from cinema
where id % 2 = 1 and description != 'boring'
order by rating desc;

 

还有用 & 也行

# Write your MySQL query statement below
select *
from cinema
where ((id & 1) = 1) and description != 'boring'
order by rating desc;

 

posted on 2017-11-26 13:45  stupid_one  阅读(153)  评论(0编辑  收藏  举报

导航