sql: delete a subtree table(id, Parentid) , delete a item with all his children

Posted by Omu on Stack Overflow See other posts from Stack Overflow or by Omu
Published on 2010-05-07T07:54:24Z Indexed on 2010/05/07 7:58 UTC
Read the original article Hit count: 180

Filed under:
|

I have a table like this

foo(id, parentId) 
-- there is a FK constraint from parentId to id

and I need to delete an item with all his children and children of the children etc. anybody knows how ?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server