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
 General SQL Server Forums
 New to SQL Server Programming
 String matching

Author  Topic 

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-05-02 : 17:34:21
I have a table in which i have a column which contains data like this...
TableA

Data
ashish,gilhotra,at,home

and there is Table B which contains data like

TableB

NAMES
ashish
pawan

so i like to put a where condition like this between two tables
where tableA.data like %tableb.names%

mean we use many times
where condition like that
where tablea.data like '%ashish%'

but there is a column this time in place of data static data

Any Help




iF theRe iS a wAy iN tHen theRe iS a wAy oUt..

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-05-02 : 18:04:41
Please try:
where tableA.data like '%'+tableb.names+'%'


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

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-05-03 : 05:26:34
Thanks a Ton ,,
but really i asked a stupid question,,,
i just get out of my mind,,
Thanks to you,,,



iF theRe iS a wAy iN tHen theRe iS a wAy oUt..
Go to Top of Page
   

- Advertisement -