This project has moved. For the latest updates, please go here.
0

Closed

Missing error message

description

This query should cause the error message below. If uncommenting the
UNION ALL the error messages appears.

The ORDER BY clause is invalid in derived tables, subqueries, and common table expressions, unless TOP is also specified.WITH MyEmployees AS (

 SELECT e.FirstName + ' ' + e.LastName AS FullName,
   e.Region,
   e.Country
 FROM Employees e
 WHERE e.Country = 'USA'
 UNION ALL

 SELECT 'Immo Landwerth',
   'Bavaria',
   'Germany'
 ORDER BY 1
)
SELECT e.FullName,
  e.Country
FROM MyEmployees e
Closed Oct 31, 2014 at 6:16 AM by terrajobst

comments