Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Union order
Message
 
 
À
29/08/2008 15:54:12
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01343299
Message ID:
01343408
Vues:
25
There's easy fix for that
SELECT  Empid, EmpName, OverTime, DoubleTime, TotalHours1 FROM (
SELECT 100 PERCENT ...
...
>I've got something wrong as I get "The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified."
>
>The extra field doesn't bother me (yet anyway) so for now...I think...I like the field :)
>
>>I think the reason for this suggestion is if you don't want to have one extra field in your result set.
>>If this is not a problem for you, you can use your original select and don't use derived table (not sure if there would be any slowdown by doing this anyway, probably not).
>>
>>>I'm not following? Wait a minute... I think I see... I'm going to try that, hold the phone.
>>>
>>>>Yes, something like that. You may have to specify ORDER BY by column # if SQL Server complains. You can also get rid of that additional column using current query as derived table
>>>>
>>>>SELECT Empid, EmpName, OverTime, DoubleTime, TotalHours1 FROM (
>>>> -- your select here
>>>> -- Order by column position instead of names
>>>> ORDER BY 1,6
>>>>) dt1
>>>>
>>>snip...
>>>>>snip...
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform