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

How can we optimize a sql query?

571


Can we create a trigger on view?

485


what is a foreign key ? : Sql dba

605


What is a sql select statement?

562


Differentiate between sga and pga.

665






What is difference between inner join and self join?

586


What is sql select statement?

503


What is the use of count (*) in sql?

542


How many row comparison operators are used while working with a subquery?

533


What is procedure and function in sql?

530


Is crud a cuss word?

541


Which is faster count (*) or count 1?

537


Can we create index on primary key?

522


What is nosql db?

536


What are string functions in sql?

672