我正在努力从我的桌子中选择尚未被当前年份修改的行。以下是我放弃的查询示例:
SELECT * FROM test_cars INNER JOIN
(SELECT car as c, type as t FROM test_cars
WHERE YEAR(modified_on)='2016' GROUP BY c,t) as tbl
ON tbl.c!=car AND tbl.t!=type
WHERE value !=''
GROUP BY car,type
答案 0 :(得分:1)
SELECT car, type
FROM test_cars
GROUP BY car, type
HAVING sum(YEAR(modified_on) = 2016) = 0