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!

last 5 records

Status
Not open for further replies.

mike1955

Programmer
Jul 21, 2005
32
0
0
GB
Using a large dBase table and want to pull out last 5 entries of a given select type. PK is incremental but records all differ in type. Select statement calling data from varius rows in the table and I just want the last 5 entries.

Tried:

select sample_number from sample
where description = 'WiTower6'
order by sample_number desc
limit 10

but think my syntax is not quite right somehow

any help gratefully appreciated

mike
 
Very close:

Code:
SELECT * FROM (
  select sample_number from sample
  where description = 'WiTower6'
  order by sample_number desc )
WHERE ROWNUM <= 5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top