Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Aliases

Author  Topic 

dcarva
Posting Yak Master

140 Posts

Posted - 2006-04-19 : 23:59:47
Hello,

Can a column have more than two aliases? I have a case the same column has the data that is being referenced by 2 different aliases. I would like to do something like this:

SELECT Value1 AS val1, val2
FROM Table1

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-20 : 00:02:27
NO. only one alias.

However you can do this

SELECT Value1 AS val1, Value1 as val2
FROM Table1




KH


Go to Top of Page

dcarva
Posting Yak Master

140 Posts

Posted - 2006-04-20 : 00:03:19
Yeah, I was hoping to not have to do that because that returns double the data. I have some ideas though.

Thanks!!
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-20 : 00:34:02
Why do you need 2 alias of the same column ?



KH


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-20 : 01:41:55
>>I have a case the same column has the data that is being referenced by 2 different aliases.

Can you explain why you need this?
Post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -