I have a query with the following syntax:
select x.a as a, x.b as b, x.c as c
from
(select distinct a from foo
order by y) as x
left join zzz....
left join yyy...;
I want to now put in an order by
into the outer select statement.
attaching it to the end - it doesn't like the syntax, and putting it before the as is apparently valid syntax, but returns an empty result set, when omitting the order by
certainly returns results.
Any theories?
Sorry about the variable names, but they're not really important - it's more about the placement of the order by
that I'm concerned.