i want to delete 20th million record how ?

Answers were Sorted based on User's Feedback



i want to delete 20th million record how ?..

Answer / rajesh

Hope this will do.

delete from tbname where rowcount(*) = 200000 ;

Is This Answer Correct ?    8 Yes 2 No

i want to delete 20th million record how ?..

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

i want to delete 20th million record how ?..

Answer / ratheesh nellikkal

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

i want to delete 20th million record how ?..

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

Post New Answer

More DB2 Interview Questions

What is a dbrm in db2?

1 Answers  


what is the name of the default db2 catalog database?

3 Answers   IBM,


Can there be more than one cursor open for any program?

1 Answers  


Do we need cursor for Count(*)?

4 Answers   iGate,


In a single table,How to retrieve a employee-id of an employee who works in more than one department?

15 Answers   Cap Gemini,


What is nvl in db2?

1 Answers  


What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.How can I solve it without using a cursor.

4 Answers   Cap Gemini, Verizon,


How Plan is created while executing the query using SPUFI?

3 Answers  


What is bind and rebind in db2?

1 Answers  


How is the SUBSTR keyword used in sql?

1 Answers  


I use CS and update a page. Will the lock be released after I am done with that page?

2 Answers  


What are the advantages of using a PACKAGE?

2 Answers  


Categories