Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Like operator

Status
Not open for further replies.

dmando84

Programmer
Dec 28, 2005
68
US
Hello,

Does anyone know how to use a like operator with a column? e.g

select name
from table1 1
join table2 2 on table1 = table2
where name like ['%] + 2.name + [%']

I need something like this. Any help would be appreciated.
 
Code:
select name 
from table1 1
join table2 2 on table1 = table2
where name like '%' + 2.name + '%'

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Might want to use Ltrim and Rtrim on your column to get rid of leading and trailing spaces, too.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top