UNION Query help

  • 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.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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
  • Luis Cazares (10/18/2013)


    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.:-)

    Even I have never used ordinal position ever, so I'm glad its deprecated.

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply