Jump to content

Using one Alias for mutiple columns in a SELECT statement

- - - - -

  • Please log in to reply
No replies to this topic

#1
reachpradeep

reachpradeep

    Learning Programmer

  • Members
  • PipPipPip
  • 41 posts
Hi all,

Is this at all possible? In the following query I have mutiple columns in my SELECT statement that each have their own alias. Is it possible that I can use just one Alias for all these columns (such as Address), and if so how is it done?

SELECT	RTRIM(ISNULL(ta.house_no_flat, '')) as [Target - Flat No.], 

		LOWER(RTRIM(ISNULL(ta.building, ''))) as [Target - Building],

		LOWER(RTRIM(ISNULL(ta.road_street, ''))) as [Target - Street],

		LOWER(RTRIM(ISNULL(ta.district, ''))) as [Target - District],

		LOWER(RTRIM(ISNULL(ta.town, ''))) as [Target - Town], 

		LOWER(RTRIM(ISNULL(ta.county, ''))) as [Target - County],

		RTRIM(ISNULL(ta.postcode, '')) as [Target - PostCode]


Thanks




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users