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 2008 Forums
 Transact-SQL (2008)
 SELECT TOP N returns all records

Author  Topic 

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2010-10-15 : 15:39:25

I have a table with 15 or so records...

sql = "SELECT TOP 3 Name, Email, Phone FROM Clients WHERE SN = @SN ORDER BY LastAccessed DESC"

...returns all records.

Why? How to fix?

Thanks!

kpg
VS2010, ASP.NET




kpg

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2010-10-15 : 15:52:13


Nevermind - stupid mistake on my part...

...below that query I had the original that got all records. ha.

kpg
Go to Top of Page
   

- Advertisement -