题目链接:点击打开链接
题目大意:略。
解题思路
“2020年”的11种写法
YEAR(sale_date) = 2020
sale_date LIKE '2020%'
sale_date REGEXP '^2020'
LEFT(sale_date,4) = '2020'
MID(sale_date,1,4) = '2020'
SUBSTR(sale_date,1,4) = '2020'
DATE_FORMAT(sale_date,'%Y') = 2020
EXTRACT(YEAR FROM sale_date) = 2020
sale_date BETWEEN '2020-01-01' AND '2020-12-31'
sale_date > '2019-12-31' AND sale_date < '2021-01-01'
sale_date >= '2020-01-01' AND sale_date <= '2020-12-31'
AC 代码
SELECT seller_name FROM Seller WHERE seller_id NOT IN (SELECT DISTINCT seller_id FROM Orders WHERE YEAR(sale_date) = '2020' AND seller_id) ORDER BY seller_name