Skip to content

Tag: db2-luw

DB2 LUW MERGE using same table to update a different row

My table data looks like this 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 ? Answer The idea is to enumerate target rows and update only the 1-st one.

nested join in Db2

Folks, what is wrong with this query i get error stating below in DB2 LUW. [42703][-206] “d.sales” is not valid in the context where it is used.. SQLCODE=-206, SQLSTATE=42703, DRIVER=4.23.42 [56098]…