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
Answers were Sorted based on User's Feedback
Answer / mithlesh
delete from table_name
where address = '456' and '678'.
| Is This Answer Correct ? | 10 Yes | 4 No |
Answer / prashant shettar
delete from (select rownumber() over() as rowid from tab1 )
where rowid = ( (select count(*) from tab1) - 1)
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / suv
We can use concept of cursor to delete particular row. The
row where the cursor is pointing will get deleted.
Please correct is wrong..
| Is This Answer Correct ? | 0 Yes | 1 No |
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 |
What is the purpose of coding FETCH in a SQL SELECT query? Explain with an example in Detail?
What is the use of predicate?
Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?
What is database alias db2?
In db2, how do you insert multiple rows in 1 query using a.) Cursors, b.) Normal query?? Give syntax for both.
What is DCLGEN?
I am having n number of records in a table which consists of emp-name is one of the field among them. Now i want to change the first letter of every name with capital.
Hi Dude,this is Ram.could any one tell me aboue CURRENT OF clause in DB2. Thanks in advance.......
why db2 is called as universal database?what is the storage capacity of db2v9 n what are the advantages of db2
What's the Maximum Length of SQLCA and what's the content of SQLCABC?
what is a corelated subquerry?
If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2