最后查询员工的老板的时候,很显然有漏洞,KING是大BOSS,他没有老板,但是他也是员工,所以这里需要用自连接加外链接,不知道我说的对不对
2017-04-28
SELECT CI_ID,GROUP_CONCAT(STU_NAME) AS STU_NAME FROM
(SELECT p.CI_ID,s.STU_NAME
FROM pm_ci p , pm_stu s
WHERE FIND_IN_SET(s.STU_ID,p.STU_IDS)) AS n
GROUP BY CI_ID;
/*mysql版本*/
(SELECT p.CI_ID,s.STU_NAME
FROM pm_ci p , pm_stu s
WHERE FIND_IN_SET(s.STU_ID,p.STU_IDS)) AS n
GROUP BY CI_ID;
/*mysql版本*/