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 2005 Forums
 SQL Server Administration (2005)
 how to view different columns

Author  Topic 

matiq12
Starting Member

7 Posts

Posted - 2010-01-28 : 05:45:57
how to view different columns having same name from different tables in same database..
kindly help..

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-01-28 : 06:18:48
select a.col1, b.col1
from table1 as a join table2 as b on (a.id=b.id)

or giving different aliases for the columns:

select a.col1 as col1_a, b.col1 as col1_b
from table1 as a join table2 as b on (a.id=b.id)

Is that what you wanted to know?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-28 : 06:37:01
duplicate of

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=138986
Go to Top of Page
   

- Advertisement -