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 report builder?
Explain magic tables in sql server?
What is constraints and its types?
What happens when transaction log is full?
What is oltp (online transaction processing)?
What is after dml trigger?
Explain microsoft sql server functions?
Explain timestamp datatype?
How do I view a script in sql server?
Why we use trigger in sql server with example?
What is the fillfactor concept in indexes?
What is difference between joins and subqueries?
Issues related in upgrading SQL Server 2000 to 2005 / 2008
Explain in brief about Microsoft SQL server?
Differentiate between SQL and ORACLE joins and write their syntax.