Hi!
i have a table with 3 fields: ParentFolder,DocumentNo and VersionNo
the DocumentNo give each document a unique number. ParentFolder is a number specifying which folder a document is in. and each document(with same name) can have many VersionNo(1,2,3 etc).
i am creating a house keeping function for user. this function accepts a number from user specifying how many version he would like to keep.
i have created a page that list out all folder in the db with a checkbox. user is able to checked the folder they want to housekeep.
the problem is how do i write a sql that will 'group' documents with same name, delete the document base on the input.
since the system only get the folder id and not each document id individually the system won't be able to pinpoint each document.
in dire need of help
Thanks in advance