SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Alias Query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

teamjai
Starting Member

India
42 Posts

Posted - 12/04/2013 :  01:06:54  Show Profile  Reply with Quote
The following SQL statement specifies two aliases, one for the CustomerName column and one for the ContactName

Query :
SELECT CustomerName AS Customer, ContactName AS ContactPerson
FROM Customers;

Customer ContactPerson
-------- ---------------
AAA BBB
CCC DDD

I need two alias name for single column.

Example

Customer1 Customer2
--------- -------------
AAA AAA
CCC CCC

is it possible in Sql Server? .Please help me.

Thanks

khtan
In (Som, Ni, Yak)

Singapore
17586 Posts

Posted - 12/04/2013 :  01:20:42  Show Profile  Reply with Quote
yes

SELECT CustomerName AS Customer1, CustomerName AS Customer12
FROM Customers;



KH
Time is always against us

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 12/04/2013 :  05:22:14  Show Profile  Reply with Quote
Cant think of a reason for this requirement though!

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000