另一个mysql减去问题

时间:2009-02-22 08:42:32

标签: mysql

我正在努力实现以下目标:

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中有一种简单的方法吗?

1 个答案:

答案 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)

应该这样做。