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 are PACKAGES ?
What are the 2 sqlcodes that are returned?
what is the input to PLAN? what is the input to DBRM?
Following a db2 update statement, what is the quickest way to compute the total number of updated rows?
Mention the downsides of page level lock.
what is SPUFI ?
What is a composite index and how does it differ from a multiple index?
Explain the EXPLAIN statement?
How do I create a table MANAGER (EMP-NO, MANAGER) where MANAGER is a foreign key which references to EMP-NO in the same table? Give the exact DDL.
What is a clustering index ?
How is a typical DB2 batch program executed ?
What are the various isolation levels possible?