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)
 Joining two tables

Author  Topic 

rebeka.six
Starting Member

2 Posts

Posted - 2008-11-22 : 09:49:26
I need help with joining these two tables:

Table1

idx idy
---------
one 1
two 2
tree 3


Table2

idy u
-------
1 a
2 b
3 c
4 d
5 e
6 f

I want to show rows from the Table1 that have idx=one joined with all the rows from Table2.
So, I want to join these two tables so that Table1.idy=Table2.idy and Table1.idx=one
The result table should look like this.

Result table:

idx idy u
--------------
one 1 a
NULL 2 b
NULL 3 c
NULL 4 d
NULL 5 e
NULL 6 f

Can anyone help me with this?
Thanks,
Rebeka

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-22 : 10:02:38
Don't cross post.
Go to Top of Page
   

- Advertisement -