>
Also remove GROUP BY because it's unnecessary and only applies to the select statement it included in.>
>So when UNIONing, SELECT DISTINCT is implicit? Or can I put the 5 SELECTs in parentheses and the GROUP BY would then apply to all?
Yes, the UNION w/o ALL performs implicit DISTINCT. You cannot apply GROUP BY to the result of the UNION query. On other hand, the ORDER BY applies to the result set not to the individual SELECTs in the UNION query.
--sb--