I want to know last five transactions or records from emp
table, from now?

Answer Posted / vasanth

HI,

Include equal to (=) in that query:

select *
from temp_search
minus (select *
from temp_search
where rownum <= (select count(*) - n from
temp_search))

Another example:

select xx.*
from (select rownum rr, a.* from temp_search a) xx
where xx.rr > (select count(1) - n from temp_search)

*- n : no of last tranactions

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does truncate remove indexes?

721


What are the different dml commands in sql?

762


What is the difference between inner join and natural join?

703


how can you create an empty table from an existing table? : Sql dba

858


What is count * in sql?

747






what is sql? : Sql dba

741


Difference between table function and pipelined function?

768


what is the difference between nested subquery and correlated subquery?

746


how to include numeric values in sql statements? : Sql dba

768


What is record type in pl sql?

747


What are character functions in sql?

663


How can I speed up sql query?

707


Describe different types of general function used in sql?

727


how to load data files into tables with 'mysqlimport'? : Sql dba

745


How do I run a sql query in pgadmin 4?

718