开发者

convert cte to mysql

i have a recursive cte in mssql which finds all children of a certain node. in db terms:

create table nodes (
     id         int primary key autoincrement,
     parent     int
)

with this table i had a cte that i used to create a view:

create view (
     node_id    int,
     child_id   int
)

how do i do that in mysql? (I cannot change the table format to accomodate other methods such a开发者_JAVA技巧s with the nested set model)

worst case, could i make a function to do it?

thanks!


You may want to look at this discussion:

How do you use the "WITH" clause in MySQL?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜