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
Why de-normalization required?
Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
What is ms sql server triggers?
When to use Inner join & when to use subquery?
What is transaction server isolation?
How to delete duplicate rows from table except one?
What is the difference between functions and scalar functions?
What is a join in sql?
What is checkpoint in sql server?
Explain about SQLOS?
Tell me what is the significance of null value and why should we avoid permitting null values?
What is the rdl file?
What are the properties of the relational tables?
How to update values in a table with update statements in ms sql server?
How to list all field names in the result set using mssql_field_name()?