Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index was not longer optimized
Message
From
06/04/2010 14:09:52
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01458951
Message ID:
01458995
Views:
34
>I don't see an ORDER BY field in your example. ORDER BY 1 is no order - do you want them to be in the clustered index order?

This is the SQL:
DECLARE @NoMember Integer

SET @NoMember=1

SELECT Thread.Numero,Thread.Title,Thread.Url,Thread.AddDate
 FROM (SELECT TOP 10 Reply.NoThread FROM Reply (NOLOCK) WHERE Reply.NoMember=@NoMember ORDER BY 1 DESC) Temp
 INNER JOIN Thread ON Temp.NoThread=Thread.Numero 
Basically, this is the one showing the last 10 replies in the Dashboard. So, ordering by 1, thus by Reply.NoThread, in DESC, would give the most recent ones as NoThread is the Thread.Numero reference, which is the primary key. Or, is it that ORDER BY 1 serves for no use in SQL Server and that I would have to use ORDER BY Reply.NoThread?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform