sql-查询
1757. 可回收且低脂的产品 - 力扣(LeetCode)
select product_id from Products where low_fats = 'Y' and recyclable = 'Y'
下面是一种较为复杂的做法,不推荐
# Write your MySQL query statement below
select product_id
FROM Products
WHERE (
(CASE WHEN low_fats = 'Y' THEN 1 ELSE 0 END) = 1
AND
(CASE WHEN recyclable = 'Y' THEN 1 ELSE 0 END) = 1
)
select name from Customer where referee_id not in (2) or referee_id is null
or
select name from Customer where referee_id != 2 or referee_id is null
select name, population, area from World where population >= 25000000 or area >= 3000000
distinct 去除重复的数值
select distinct author_id as id from Views where author_id = viewer_id order by id
select tweet_id from Tweets where length(content) > 15

浙公网安备 33010602011771号