SELECT id,nickname,himg,(SELECT count(*) FROM t_user WHERE pid = t1.id) as count FROM t_user t1 WHERE pid = 0
SELECT id,nickname,himg,(SELECT count(*) FROM t_user WHERE pid = t1.id) as count FROM t_user t1 WHERE pid = 0
本文标题:mysql 查询上级信息以及下级的数量
本文链接:https://www.haomeiwen.com/subject/hjerjdtx.html
网友评论