Skip to content
Advertisement

DB2 LUW MERGE using same table to update a different row

My table data looks like this

enter image description here

My poorly attempted SQL is this…

It is updating all rows in the table. I do not want this.

How can I make it ONLY update the 1 latest PRINTED row which has an empty PDF_FILE ?

Advertisement

Answer

The idea is to enumerate target rows and update only the 1-st one.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement