答案 0 :(得分:1)
我认为此查询适合您:
SELECT @id := (SELECT ms_menu_id FROM ms_menu WHERE ms_menu_parent = @id)
AS menu_id FROM (SELECT @id := 3) vars STRAIGHT_JOIN ms_menu WHERE
@id !=0 union all (select ms_menu_id from ms_menu where ms_menu_id=3)
order by menu_id ASC limit 1, 18446744073709551615
结果应为:3,4,6,11