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
How to test SQL -911 error while developing COB-DB2 program
What is collection in db2 bind?
What is the advantage in De-normalizing tables in DB2?
What is meant by dclgen?
List out the data types available.
What is dclgen in db2?
What is universal database?
How to check last update on table in db2?
What is db2 instance?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
How would you find out the total number of rows in a db2 table?
What are foreign keys in db2?
What does a deadlock mean in DB2?
What is the role of data manager in the db2 database?
What is dbrm library?