• ScottPletcher (10/18/2013)


    T.Ashish (10/17/2013)


    Jeff Moden (10/17/2013)


    ScottPletcher (10/17/2013)


    Or just:

    ORDER BY 1

    I often avoid using the column names at all in UNIONed queries, as the names somehow seem to

    change a lot 🙂 :

    Thank goodness that method has finally been deprecated.

    +1 for Jeff Moden

    Why? Just makes it more difficult to order complex columns and/or UNIONed statements.

    Is as simple as using column aliases from first query.:-)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2