i want to delete 20th million record how ?
Answers were Sorted based on User's Feedback
Answer / rajesh
Hope this will do.
delete from tbname where rowcount(*) = 200000 ;
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / sxion045
CREATE VIEW RR(A,B,X) AS
SELECT R.*, ROW_NUMBER()
FROM R;
DELETE FROM RR
WHERE X=20000000;
| Is This Answer Correct ? | 2 Yes | 0 No |
Hi All,
I don't think RR and ROWCOUNT works in DB2 for LUW.
So you could go for another option.
Row_number() Over() function you can use for this puspose.
Eg.
delete from (
select row_number() over() as row_num from
TEST.TABLE_TEST )
where row_num=20000000;
where TEST is my schema name and
TABLE_TEST is my test table.
Cheers Guys.
Ratheesh Nellikkal
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / magesh
delete from (select row_number() over() as COLUMN1 from
TABLE_OWNER.TABLE_NAME )
where COLUMN1=20000000;
| Is This Answer Correct ? | 0 Yes | 1 No |
What is image copy?
How to resolve the -305 error code in DB2? And also please let me know, how to resolve the db2 error codes.
Which isolation level provides highest data integrity?
What are the isolation levels possible ?
What is the syntax of SELECT statement when embedded in a COBOL program?
what is diffrence b/w file-aid tool and file-aid utility???
can I alter a table (e.g. adding a column) when other user is selecting some columns or updating some columns from the same table?
What do the initials DDL and DML stand for and what is their meaning?
What is reorg and runstats in db2?
How to restart a DB2 program?
How can we define a table? How can we apply SEARCH ALL on it ?
How do u achieve record level locking in DB2 versions when record level locking is not allowed?