SELECT GROUP_CONCAT(t2.id)
FROM
(
SELECT
@r AS _id,
(SELECT @r := parent_id FROM zcm_users WHERE id = _id) AS parent_id
FROM
(SELECT @r := 25) vars, zcm_users
WHERE @r <> 0
) t1
JOIN zcm_users t2
ON t1._id = t2.id
image.png
网友评论