i have a table like this :
Name ADDRESS
Toto 123 ...
Toto 456
ToTo 678
I would like to delete 2 last row...please tell me how to
delete its
Answer Posted / vaneesh khurana
I think better to perform this in following 2 queries
1. Select count(WS-COUNT) from TABLE;
2. DELETE FROM TABLE WHERE ROWCOUNT(*) IS WS-COUNT OR
(WS-COUNT-1);
Basically here the first row will give you the record count
and 2nd will delete the last and the 2nd last row.
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
What is the difference between db2 and oracle?
What are packages in db2?
While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?
What is database alias db2?
What is role in db2?
What is the physical storage length of the data types date, time, and timestamp?
How do you stop a db2 database in linux?
How can you count the number of rows from a table tab?
What are the various isolation levels possible?
what are bind concepts in db2 cobol?
What is the difference between "db2ilist" and "db2 get instance" commands in DB2 Database Server?
Explain dclgen.
what is db2 restart?
What is commit in db2?