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...

wat will be the sql query to extract only last 3 records
from table supose table hving thousands for records

Answer Posted / arun kumar k s

drop table #temp select identity(int,1,1) as SlNo, * into
#temp from TABLE_NAME select top 3 * from #temp order by
SlNo desc

arun_4454@yahoo.co.in

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is your recommendation for a query running very slow? : sql server database administration

1057


What is the difference between set and select?

1102


What is SQL Azure Federations?

112


What are the components of sql server service broker?

1026


What are various limitations of the views?

1062


What is the difference between inner join and equi join?

1005


How to select some specific columns from a table in a query in ms sql server?

1008


What is database mirroring?

1123


How do we synchronize On-Premise SQL server with SQL Azure?

122


What is difference between order by and group by?

1017


Explain the properties of sub-query in sql server?

1025


how to define testing of network layers? : Sql server database administration

981


What is coalesce in sql server?

1064


You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?

997


What is use of except clause?

1096