陈长瓦 2022-10-13 21:31 采纳率: 0%
浏览 169
已结题

mysql sql语句问题

SELECT c.id, (select @b:=c.id) as 'iid',
(select a._id from
(SELECT @c '_id',
(select @c:=parent_id from sys_menu where id = _id) 'parent'
from sys_menu sys,(select @c:=@b) r) a where _id is not null and parent is null) 'parent'
from (SELECT * from sys_menu s where id in(8,11)) c

请问这个sql语句错在哪里,id为8 的结果是对的,id为11的结果不对,变量传递的有问题吗

  • 写回答

8条回答 默认 最新

  • qqlxinye 2022-10-13 22:22
    关注

    太多关联。看的好晕。这么多关联从最后开始看。结果一条一条对比

    评论

报告相同问题?

问题事件

  • 系统已结题 10月21日
  • 创建了问题 10月13日