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
Define constraints and give an example of their use?
what is checksum in sql server.........???
What is the meaning of resultset type_scroll_insensitive?
What is the native system stored procedure to execute a command against all databases?
What is a rollup clause?
Do you know what is raid and what are different types of raid configurations? : SQL Server Architecture
Does a sql server 2005 select statement require a from?
What are the different types of subquery?
How can I know what locks are running on which resource?
What is the difference between sdf and mdf?
What are sql dirty pages?
What is 2nf example?
How to query multiple tables jointly?
What are types of scd? : sql server analysis services, ssas
can a table be moved to different filegroup? : Sql server administration