I need to write a valid T-SQL query version of the following pseudo-code:
select * from newTable where [name] like in (
select [name] from oldTable
)
I'm not sure how to go about this. Any help (even directing me to an existing question) would be great. Thanks!
Edit: Per some comments I will clarify this particular case. The tables look like this:
oldTable
code varchar(10)
name varchar(500)
newTable
code varchar(10)
name varchar(500)
In all of the cases where oldTable.code <> newTable.code, I am wanting to see if the oldTable.name is like one of the names in newTable.name. Basically, some of the new names have had qualifiers added to the beginning or end of the names. ie: 'old name' may have a 'qualified old name' in the newTable. Thanks again.