Assigning new name to column in returned results

  • I have a query that pulls two values from the same column in the same table.  Is it possible to "rename" the two columns (in the returned results only) so that they can be referred to by the new names and not the original name for the column?

  • Hello Mark,

    Yes, you can refer them with the alias names you want. Please go through BOL for topic "Assigning Result Set Column Names"

    Thanks and have a great day!!!


    Lucky

  • SELECT col1 AS 'A', col1 AS 'B'

    FROM myTable

    The clientside will refer to the columns as 'A' and 'B'.

    /Kenneth

Viewing 3 posts - 1 through 2 (of 2 total)

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