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 options are there to delete rows on the publisher and not on the subscriber? : sql server replication

1257


Do you know what are different types of replication in sql server?

1154


On a windows server 2003 active – passive failover cluster, how do you find the node which is active?

1249


What triggers long term care?

1087


what are the reporting service components in SSRS?

170


explain extended properties

1036


What is usually the first word in a sql query?

1174


Beginning with sql server version 7 0, a new enhanced data type nchar was added what type of data is supported with this data type?

1064


What are diverse clauses that form a part of sql?

1110


What is ddl and dml commands?

958


Explain trigger and trigger types?

1035


What are partitioned views and distributed partitioned views?

1061


What is cte (common table expression)?

1085


How connect excel to sql server?

1051


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1166