Get all children by parent id and where clause in mysql

后端 未结 2 1344
生来不讨喜
生来不讨喜 2021-01-17 05:50

I have a table that stores id and parent_id in same table. I want a recursive query that accepts parent_id as an argument and returns all child nodes with nth level. For thi

2条回答
  •  伪装坚强ぢ
    2021-01-17 06:27

    I think it'll be easier to create a joint rather then using sub-queries, but without seeing the design of tables you are using I'm afraid I can't really give you good example.

提交回复
热议问题