I have a TSQL query that has a subquery listing 2 names:
Coop
Bro
Select LastName from Managers where Type = prefix;
I need to have the outer query use this above sub-query in something like an 'IN' statement, but it's not an exact match, but rather a BEGINS WITH. Something like the following with + '%':
Select * from Employees where LastName IN (Select LastName + '%' from Managers where Type = prefix)
Desired query would bring back outer query results such as:
Cooper
Coopersmith
Coopmoth
Brown
Brownly
Bronnan
...but, this is not working. I get 0 results.