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

Answers were Sorted based on User's Feedback



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

Answer / prakash r

Hi,

Please try the below query

Table
------
create table TEMP_SEARCH
(
F1 VARCHAR2(100),
F2 VARCHAR2(100),
F3 VARCHAR2(100)
)

select * from TEMP_SEARCH

Rownum F1 F2 F3
-----------------------------
1 1 500 DES1
2 2 600 DES2
3 3 550 DES3
4 4 760 DES4
5 5 899 DES5

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

This will give the last two transaction

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More SQL PLSQL Interview Questions

Is mariadb a nosql database?

0 Answers  


table having two columns - entity,zone enity zone pen east pen west pen north pen south pen east pencil east pencil east pencil west I want the output as : entity east west north south pen 2 1 1 1 pencil 2 1 0 0

2 Answers  


What programs use sql?

0 Answers  


what is a database lock ? : Sql dba

0 Answers  


What is #table in sql?

0 Answers  






What does partition by mean in sql?

0 Answers  


Does truncate need commit?

0 Answers  


how to convert dates to character strings? : Sql dba

0 Answers  


What is rename in sql?

0 Answers  


What is the order of sql select?

0 Answers  


What is the maximum number of rows in sql table?

0 Answers  


The select into statement is most often used to create backup copies of tables or for archiving records?

0 Answers  


Categories