Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we accept inputs from user during runtime?

1043


What is oracle pl sql developer?

964


Why is there a need for sqlcode and sqlerrm variables?

1030


what does myisamchk do? : Sql dba

1002


How can we avoid duplicating records in a query?

958


how many triggers are allowed in mysql table? : Sql dba

1041


Can we have two clustered index on a table?

1011


What is nvl?

1052


How do you change a value in sql?

1000


what are the limitations of identity column? : Transact sql

1088


What is the difference between Union and Union all. Which is faster.

1382


What is the syntax and use of the coalesce function?

1144


How do I remove sql plus from windows 10?

1078


Does sql between include endpoints?

989


what is 'trigger' in sql? : Sql dba

1068