日期:2014-05-18 浏览次数:20443 次
SELECT a.[Emp_Id],a.[name]FROM [DB_Emp] a,[DB_Emp_Like] b WHERE a.[Emp_Id]=b.[Emp_Id] AND b.[Like_No] IN (101,102,103) AND EXISTS( SELECT 1 FROM [DB_Emp_Like] WHERE [Emp_Id]=b. [Emp_Id] AND [Like_No] IN (101,102,103) GROUP BY [Emp_Id] HAVING COUNT(DISTINCT [Like_No])=3 ) /* Emp_Id name ----------- ---- 5 赵刚 5 赵刚 5 赵刚 (3 行受影响) */