Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ordering on UNION
Message
From
27/03/2016 10:55:40
 
 
To
27/03/2016 04:40:24
Walter Meester
HoogkarspelNetherlands
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01633812
Message ID:
01633831
Views:
44
>
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform