Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ordering on UNION
Message
De
27/03/2016 10:55:40
 
 
À
27/03/2016 04:40:24
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01633812
Message ID:
01633831
Vues:
47
>
>SELECT * FROM 
>   (SELECT TOP 10 * FROM A ORDER BY MyField
>   UNION ALL
>   SELECT TOP 10 * FROM B ORDER BY AnotherField) as x
>ORDER BY CommonField
>
This does not work. Putting TOP 10 in both selects causes the problem. As this is the most recent top 10 of everything, it has to be put outside of the derived table.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform