I need to write a valid T-SQL query version of the following pseudocode:
select * from newTable where [name] like in (
select [name] from oldTable
)
I am not sure how to do this. Any help (even directing me to an existing question) would be wonderful. Thanks!
Edit: For 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 cases where oldTable.code <> newTable.code, I want to see if oldTable.name looks like one of the names in newTable.name. Basically, some of the new names have added qualifiers to the beginning or end of the names. i.e.: "old name" may have "qualified old name" in newTable. Thanks again.
source
share