Mark Harley
SSCrazy
Points: 2259
More actions
March 6, 2006 at 9:01 am
#168606
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?
lucky-80472
SSCertifiable
Points: 7793
March 6, 2006 at 9:08 am
#624944
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
Kenneth Wilhelmsson
SSC-Dedicated
Points: 30043
March 6, 2006 at 9:09 am
#624945
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