Viewing 2 posts - 1 through 3 (of 3 total)
Having analyzed your query, see what happens when you run it like this (sorry had to trim it down a bit for readability 🙂 )
SELECT D1.SID_0COMPANY AS SID_0COMPANY
FROM ...
December 14, 2007 at 5:45 am
#760170
put both your query in an inline view then order the view...
Select * from
(
SELECT a, b, c from TableA
UNION
SELECT a, b, c from Table B
) RESULTS
ORDER BY a...
December 14, 2007 at 3:09 am
#760128