Howdy DB2ers,
Riddle me this…I copied the syntax below directly from IBM.
http://publib.boulder.ibm.com/infoce...63%6c%69%22%20
DELETE FROM
(SELECT ROW_NUMBER() OVER(PARTITION BY USER_SID ORDER BY USER_SID)
FROM
BILL.TEST_USERS AS TU(RN)
WHERE
RN=1
)
;
When I execute it, I get SQL0158N, SQLSTATE 42811. Searched the web and the forum but did not find anything I recognized as a solution for my particular query. What gives?
The number of column names specified must be equal to the number of columns in the result table of the associated fullselect. If name is a staging table and the associated materialized query table has group by clause, the number of column names specified must be 2 more than the number of columns in the materialized query table for which the staging table is being defined. If the associated materialized query table has no group by clause, the number of column names specified must be 3 more than the number of columns in the materialized query table.
The statement cannot be processed.
User Response:
Correct the syntax so that the list of column names defined for name specify a name for each column of the result table.
Thanks in advance for your lessons...
Bill
Server Info:
SunOS 5.9 sun4u sparc SUNW,Ultra-Enterprise
DB2 Version:
Product Name = "DB2 Enterprise Server Edition"
Version Information = "8.2"
Product Name = "DB2 High Availability Disaster Recovery Option"
Version Information = "8.2"
Product Name = "DB2 Advanced Security Option"
Version Information = "8.2"
DB2 v8.1.0.64
FixPak 7
Type ESE