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 / kumar

You will be do following things one by one in sql server.

first create table.

1.create table tablename(sno int identity(1,1) primar key,
names varchar(100))

insert the record one by one.

2.
Insert into tablename(names) values ('arun')
Insert into tablename(names) values ('arun')
Insert into tablename(names) values ('arun')
Insert into tablename(names) values ('arun')
.
.
.
.
To Insert 1000 record one by one.

Then to execute the following query to get last 3 record.

select top 3 * from tablename
order by 1 desc


you will be get the correct answer ok.

By
kumar

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I start sql server?

978


What security features are available for stored procedure?

1036


How the authentication mode can be changed?

1135


Where is trigger in sql server?

1050


What does COMMIT command do?

1067


How to find the list of fixed hard drive and free space on server?

1203


What is subquery explain with example?

1066


what is the information that can be stored inside a bit column? : Sql server database administration

969


How to convert a numeric expression from one data type to another?

1019


What is the security model used in sql server 2005?

1011


What do you understand by user-defined function in the sql server?

956


Explain about system stored procedure?

1036


List down some advantages of sql stored procedure?

966


Can a database be shrunk to 0 bytes, if not, why?

1108


Are all views updatable ?

1154