Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetching rows

Status
Not open for further replies.

riya

Programmer
Mar 1, 2001
12
0
0
IN
hi all,

This is a very urgent requirement.I need to fetch the last 10 rows of a table data.(no temporary tables must be used).
Thanx in advance

 
Assuming you want the last 10 records based on the value of field1 ..

select top 10 * from table1 order by field1 desc
Ben
+61 403 395 052
 
if you're using sql6.5, then use rowcount.

set rowcount 10
select * from names order by field1 desc




Andel
andelbarroga@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top