Skip to main content
11-Garnet
November 10, 2023
Solved

Sql query which deletes duplicate versions of document.

  • November 10, 2023
  • 1 reply
  • 1367 views

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!

 

 

 

Best answer by avillanueva

SELECT IDA2A2 FROM WTDOCUMENT

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

1 reply

avillanueva
23-Emerald I
23-Emerald I
November 10, 2023

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.

11-Garnet
November 10, 2023

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

avillanueva
23-Emerald I
23-Emerald I
November 10, 2023

SELECT IDA2A2 FROM WTDOCUMENT

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