Maison > Questions et réponses > le corps du texte
1.上图两个表,要求找出掌握Skills中全部3个技能的员工,即神崎和相田,要求用mysql的语句实现
2.刚学sql,不是很会,想了好久
3.下面是书里面用sql server写的,我也不是很理解,另外mysql中没有except
SELECT DISTINCT emp FROM EmpSkills ES1 WHERE NOT EXISTS (SELECT skill FROM Skills EXCEPT SELECT skill FROM EmpSkills ES2 WHERE ES1.emp = ES2.emp);
三叔2016-11-08 09:28:27
SELECT DISTINCT emp FROM EmpSkills s WHERE NOT exists(SELECT skill FROM skills WHERE skill NOT IN (SELECT skill FROM EmpSkills Es2 WHERE Es2.emp = s.emp));
对应的数据替换一下就可以了.