cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Sql query which deletes duplicate versions of document.

pplmoperations
11-Garnet

Sql query which deletes duplicate versions of document.

Need sql query which deletes duplicate iterations and version of document.

Also need sql query for fetching duplicate Document ida2a2 value.

 

Appreciate your help, Thank you!

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

SELECT IDA2A2 FROM WTDOCUMENT

WHERE IDA3MASTERREFERENCE = (SELECT IDA2A2 FROM WTDOCUMENTMASTER WHERE WTDOCUMENTNUMBER LIKE 'YOURNUMBERHERE')

View solution in original post

4 REPLIES 4

It should not be possible to have duplicate iterations and versions of a document. IDA2A2 must be unique and there should be a constraint that enforces this. Are you talking about purging? Did something occur in your database? 

 

If you are referring to iteration history, you do not do this via SQL but use purge manager to clear those. 

 

if you are referring to Query Builder reports, there is an option to remove duplicates if you are not already filtering for things like latest iteration in your constraints. 

 

If this is some deep database issue, please explain more since something does not seem right.

I need sql query to fetch ida2a2 value of document of all versions and iterations

SELECT IDA2A2 FROM WTDOCUMENT

WHERE IDA3MASTERREFERENCE = (SELECT IDA2A2 FROM WTDOCUMENTMASTER WHERE WTDOCUMENTNUMBER LIKE 'YOURNUMBERHERE')

Thank you very much!

Announcements


Top Tags