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 difference between Plan and Package

1 Answers   Syntel,


what is difference between random and sequence file access

1 Answers   Syntel,


what needs to be done if a table is in copy pending / check pending status?

5 Answers   Xansa,


What is REORG? When is it used?

4 Answers  


What is phantom read in db2?

0 Answers  






what is difference between Static call and Dynamic call? How does it function?

1 Answers   Syntel,


When do you use the IMAGECOPY?

4 Answers  


How is the value function used?

0 Answers  


Are view updateable?

0 Answers  


How can i install db2 9.x on AIX based system..? plz reply the detailed steps involved....?

0 Answers   IBM, TCS,


what is plan? is plan executable or package?

4 Answers  


What is a db2 cursor?

0 Answers  


Categories