我正在努力实现以下目标:
SELECT id, name FROM t_profiles MINUS (SELECT p.id, p.name FROM t_profiles AS p LEFT JOIN t_skills AS s ON p.id = s.id_employee WHERE s.lvl>0 and s.id_task=1)
在MySQL中有一种简单的方法吗?
答案 0 :(得分:2)
SELECT id, name FROM t_profiles
WHERE id not in
(SELECT p.id FROM t_profiles AS p
LEFT JOIN t_skills AS s ON p.id = s.id_employee
WHERE s.lvl>0 and s.id_task=1)
应该这样做。