Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 finding last 10 entries

Author  Topic 

lauramayer
Posting Yak Master

152 Posts

Posted - 2004-07-09 : 13:17:54
Good afternoon,

I need to write a query to find the last 10 entries in a table with 3 million records. There is a primary key that the user would search on.

So this is what I need it to do:

SELECT top 10 from dbo.tblTrailerRouteHistory
where trailerID = PostTrailerID (meaning this is pulling from a form)

Thanks for any help.

Laura

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-07-09 : 13:18:55
SELECT top 10 from dbo.tblTrailerRouteHistory
where trailerID = PostTrailerID
ORDER BY PKColumnName DESC

Tara
Go to Top of Page

lauramayer
Posting Yak Master

152 Posts

Posted - 2004-07-09 : 13:42:15
Thanks as always Tara

Laura
Go to Top of Page
   

- Advertisement -