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

How do I add a column in db2?

0 Answers  


What is a DB2 plan?

8 Answers  


How do I import data from excel to db2?

0 Answers  


What is a system catalog table in db2?

0 Answers  


what are the copybook changes generally we done?can anyone tell me......... Thanks in advance........

1 Answers  






If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?

0 Answers  


What is meant by dclgen?

0 Answers  


What do you need to do before you do EXPLAIN ?

1 Answers  


How to design maps

1 Answers   Virtusa,


What do you mean by storage group (stogroup)?

0 Answers  


How can you count the number of rows from a table tab?

0 Answers  


What will the FREE command do to a plan?

2 Answers  


Categories