I found another similar hit which said to use this with z/OS 9.1:
Code:
DELETE FROM emp1
WHERE RID(emp1)
IN (SELECT rid
FROM (SELECT RID(emp1) rid
, ROWNUMBER() OVER(PARTITION BY emp_no , salary) rn
FROM emp1 )
WHERE rn > 1 )
but when I use my own version of this:
DELETE FROM MYDB.PTB
WHERE RID(MYDB.PTB)
IN (SELECT rid
FROM (SELECT RID(MYDB.PTB) rid
, ROWNUMBER() OVER(PARTITION BY col1, col2, col3) rn
FROM MYDB.PTB where VALID = 'Y' AND PLATFORM = 'AIX' and data = 'ABC')
WHERE rn > 1 )
I get another error:
An error occurred while running the query.
[IBM][CLI Driver][DB2] SQL0104N An unexpected token "<EMPTY>" was found following "". Expected tokens may include: "CORRELATION NAME". SQLSTATE=42601
or the same in QMF on MVS:
SQL error at or before <EMPTY>
or in Command Editor (DB2 Connect for Windows 9.5 FP1)
SQL0104N An unexpected token "<EMPTY>" was found following "". Expected tokens may include: "CORRELATION NAME". SQLSTATE=42601
SQL0104N An unexpected token "<EMPTY>" was found following "". Expected tokens may include: "CORRELATION NAME".
Explanation:
A syntax error in the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure was detected at the specified token
following the text "<text>". The "<text>" field indicates the 20
characters of the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure that preceded the token that is not valid.