1. How can I get recent 10 records out of 100 records?
SELECT *
FROM (Select *
from employee
order by rowid desc)
WHERE ROWNUM < 11
2.When would you use inline view in sub query?
You may use inline view when you want to cut short multi-join of tables.
3. How to select the recently updated records from the table?
There is no provision you can use to find out the records from the table. You may use auditing tables with the help of Triggers.
Use the date function to achieve the results.
select to_char(to_date(999999,'j'),'jsp') from dual;
But it is better you write your own translate function because it doesnt support beyond 999999.
Higher range might work in 64-bit OS.
Comments