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

What is rank () in sql?

0 Answers  


What is database sql?

0 Answers  


What is pl sql collection?

0 Answers  


diff b/w function and procedure?

9 Answers   iFlex,


What is pl sql in dbms?

0 Answers  






What are triggers and its uses?

0 Answers  


What is function and procedure in pl sql?

0 Answers  


Does oracle roll back the transaction on an error?

0 Answers  


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

0 Answers  


What is a pdo connection?

0 Answers  


What is the best strategy to use COMMIT in a pl/sql loop?

3 Answers  


Mention what pl/sql package consists of?

0 Answers  


Categories