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 2008 Forums
 Transact-SQL (2008)
 Want the required result

Author  Topic 

shahakshit
Starting Member

2 Posts

Posted - 2010-08-03 : 02:28:04
I two tables, first one has 2 columns id and name and second one has 2 columns, first column is ID and second one is the comma saprated ids of first table

First Table
ID Name
1 A
2 B
3 c
4 d

Second Table
ID IDs
1 1,2
2 3,4

Now want to write an query which will return me the result like this from second table.

ID IDs
1 1
1 2
2 3
2 4

Please help. Thaks in advanced.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-03 : 02:30:39
see 4th scenario in below link

http://visakhm.blogspot.com/2010/01/multipurpose-apply-operator.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

shahakshit
Starting Member

2 Posts

Posted - 2010-08-03 : 03:00:45
Thanks a lot, it works.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-03 : 03:07:26
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -