quary for
1> fetch last record
2> fetch in reverse order
3> fetch last 5 row
4> fetch second last record (their is no primary key)
i think concept of count can be use for this in 4th
Answer Posted / sudipta
the 4th answer is(ignore the previous one)
db2=> with t1(a,b,c) as (select id,name,row_number()
over(order by id desc) as aa from tab1) select * from t1
where c=2
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
can all users have the privilage to use the sql statement select * (dml)?
What are the benefits of using the db2 database?
On which levels locks can be applied?
what is utility for parm lib
Mention data types used in db2 ?
What is the use of value function?
How to find primary key of a table in db2?
What is db2 catalog database?
What is the cobol picture clause of the db2 data types date, time, timestamp?
What is dbrm? What it contains?
How do I delete a table in db2?
by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?
How do we specify index to include or not during bind process.
what is diffrence b/w file-aid tool and file-aid utility???
What is syscat in db2?