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)
 Like Statement

Author  Topic 

danasegarane76
Posting Yak Master

242 Posts

Posted - 2007-08-25 : 03:15:56
Hi all,
I have two tables with one field(nid) as one table(tblone) and and tbltwo.The values in the tblone are 1,2,3 and etc. And the in the second table the fields are inserted with column separted like ;1;2; etc.Now I want to retrive the all the values in the tblone by comparing the values in the tbltwo.How can I.

I want to use the join.But If i use the join in the joining condition the using in operator.Hw can I

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-25 : 03:43:11
select tblone.nid, tbltwo.nid
from tblone
inner join tbltwo on ';' + tbltwo.nid + ';' like '%;' + tblone.nid + ';%'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-25 : 04:51:26
Also refer
http://www.datamodel.org/NormalizationRules.html
http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm


Madhivanan

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

danasegarane76
Posting Yak Master

242 Posts

Posted - 2007-08-25 : 04:59:42
Thanks to Peter and Madhi.
More things to study :)

Thanks once again
Dan
Go to Top of Page
   

- Advertisement -