Delete recursive children
问题 I have the following sql that gets me all the children and grandchildren of a root forumpost. with recursive all_posts (id, parentid, root_id) as ( select t1.id, t1.parent_forum_post_id as parentid, t1.id as root_id from forumposts t1 union all select c1.id, c1.parent_forum_post_id as parentid, p.root_id from forumposts c1 join all_posts p on p.id = c1.parent_forum_post_id ) select fp.id from forumposts fp inner join all_posts ap on fp.id=ap.id where root_id=1349 group by fp.id Thing is I