i want to delete 20th million record how ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a cursor in programming?

596


Mention the various locks that are available in db2.

616


If I have a view which is a join of two or more tables, can this view be updateable?

694


I HAVE 500 ROW TO UPDATE I WOULD LIKE TO USE ROLLBACK ALONG WITH COMMIT.WHAT IS THE SYNTAX TO CODE COMMIT AND ROLLBACK FOR EVERY 100 ROWS.AND HOW THE CURSOR ROLLBACK TO THE LAST COMMITTING POINT.

2757


What is the default page size of buffer pools?

650






Which isolation level provides highest data integrity?

599


How to find the number of rows in a db2 table?

644


When the like statement is used?

640


What is temporal table in db2?

604


What does db2 plan contain?

573


Which command is used to remove all rows from a table?

553


What does sqlcabc has?

633


How do I add a column to an existing table in db2?

592


What does db2 blu stand for?

662


What is the role of schema in the db2 database?

653