Link to home
Start Free TrialLog in
Avatar of Sam OZ
Sam OZFlag for Australia

asked on

sql server search a table field like another table field

I have two sql server 2016 tables Table1 , Table2   with a fled myName in both filed
How can have a query that looks a table1 myname like table2 myname
I tried table1.myName like '%'  ||  table2.myName || '%'    but that seems to be not correct
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SQL Server uses + rather than || to do concatenation.  This is throughout T-SQL.  || has no meaning to SQL Server.