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 the various locks available?
what will be the output of the below given query, if no matching records are found : (a.) 0 (b.) null (c.) error select Avg(salary) from TableA where Deptno = 'insurance'
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
Mention and explain the contention situations caused by locks?
Why db2 is called db2?
What is a correlated sub query?
While creating a table, by mistake you have given size of one field as 10. But as per requirement size should be 8. What is your next step?
What is copy pending and check pending in db2?
what are bind concepts in db2 cobol?
On the create tablespace, what does the CLOSE parameter do?
what is Static and dynamic linking
What do you need to do before you do EXPLAIN ?