I have a table that includes a list of all the folders in an account. In my table I have a "FolderID" column and a "ParentFolderID" column.
When a user creates a new subfolder, it takes the Parent Folder's ID (FolderID) and writes it to the "ParentFolderID" column. This relates the subfolder to the Parent Folder.
When they create a Sub-sub-Folder, it takes the Sub-folder's ID and writes it to the "ParentFolderID" column.
Each user is allowed to create as many subfolders as they would like.
My question is, when they want to delete a Parent Folder, what query can I use to find all the sub-folders that are located underneath it?
mattcase
Member
374 Points
518 Posts
Hierarchy
May 24, 2012 05:39 PM|LINK
Hi,
I have a table that includes a list of all the folders in an account. In my table I have a "FolderID" column and a "ParentFolderID" column.
When a user creates a new subfolder, it takes the Parent Folder's ID (FolderID) and writes it to the "ParentFolderID" column. This relates the subfolder to the Parent Folder.
When they create a Sub-sub-Folder, it takes the Sub-folder's ID and writes it to the "ParentFolderID" column.
Each user is allowed to create as many subfolders as they would like.
My question is, when they want to delete a Parent Folder, what query can I use to find all the sub-folders that are located underneath it?