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 exactly sql injuction.how to overcome.....
What is the use of group by clause?
What are key constraints?
Can one drop a column from a table?
Explain sql delete command?
What does the on delete cascade option do?
What is the security principal at the database level that represents your session?
Differentiate between ms sql server reporting services vs crystal reports?
How to connect Azure federated root database and apply federation in entity framework?
What are two difference between sql azure and azure tables?
What is plan freezing?
Why truncate is ddl?
What is the Main Difference between ACCESS and SQL SERVER?
How to select true false based on column value in sql server?
How to insert data with null values?