结果为啥顺序不一样,子查询的结果我也测试过了,挺正常啊。
SELECT T.CI_ID, WM_CONCAT(T.STU_NAME) FROM (SELECT S.STU_NAME, C.CI_ID, INSTR(C.STU_IDS, S.STU_ID) FROM PM_CI C, PM_STU S WHERE INSTR(C.STU_IDS, S.STU_ID) > 0) T GROUP BY T.CI_ID
SELECT S.STU_NAME, C.CI_ID, INSTR(C.STU_IDS, S.STU_ID)
FROM PM_CI C, PM_STU S
WHERE INSTR(C.STU_IDS, S.STU_ID) > 0
子查询结果