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
 Transact-SQL (2005)
 How to Make alias Name

Author  Topic 

robinsimon_m
Starting Member

1 Post

Posted - 2008-12-30 : 00:58:17
Hi

I am having a table T1 with 3 fields F1,F2 and F3.
I am having another table T2 With field names F4,F5,F6.

These 2 tables are having a common field X for relationship

When i retrieve some data from table T2, I need the field name should display the data tat entered in the T1

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-30 : 01:00:52
just do

SELECT T1.X AS T1X,T1.F1,T1.F2,T1.F3,T2.X AS T2X,T2.F4,T2.F5,T2.F6
FROM T1
JOIN T2
ON T2.X=T1.X
Go to Top of Page
   

- Advertisement -