Found this on the web, i'm trying to delete records out of a file based on the RRN but nothing works. Why can't i just "delete from table where RN > ?" In my table, i'm wanting to delete every record beyond 4651.
Do i have to do a fullselect, and what does the OVER function do?
(SELECT ROW_NUMBER() OVER(PARTITION BY USER_SID ORDER BY USER_SID)
BILL.TEST_USERS) AS TU(RN)
still doesn't work. Is it something to do with the version of SQL i'm running perhaps?
No one might be able to help you with such too little and vague information.
Please supply more information. At least, following item 1) and 2) are mandatory.
1) DB2 version/release and platform OS.
2) What means "doesn't work"?
2-1) Got error message(s) at compile(prepare) time or executtion time?
If so, Give us the error message(s) with full message text and codes.
2-2) Or, were results different from your expectations?
Supply test data, your received result, and your expected result.
3) From what client software did you issued the delete statement.