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
What is the maximum size of sql server database?
What is recompile sql server?
Explain what stored procedure sp_replcounters is used for? : sql server replication
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
What is dbcc? Give few examples.
Mention the differences between local and global temporary tables.
what types of replication are supported in sql server? : Sql server database administration
What are subquery and its properties?
How many full-text indexes can a table have?
What is scalar user-defined function?
What is difference between joins and subqueries?
How to delete exactly duplicate records from a table?
What is the difference between commit and rollback?
What is exclusive locks?
Which sql server is best?