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?
精彩评论