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

what are the different type of sql's statements ? : Sql dba

926


What is denormalization in a database?

1060


What is a unique constraint?

1081


Name the operator which is used in the query for pattern matching?

960


What is left join in postgresql?

1051


Mention what does the hierarchical profiler does?

1097


how to select unique records from a table? : Sql dba

1117


What is the use of double ampersand (&&) in sql queries? Give an example

1142


What is oracle sql called?

925


In a distributed database system, can we execute two queries simultaneously?

1098


How do you update a value in sql?

1047


What is %s in sql?

1038


How many joins can you have in sql?

940


What are the methods of filing?

935


What are different types of indexes?

1014