leveetated
Programmer
Hello all,
SQL Server 2005. I have a query where I want to see if any of the values of one field in one table appear ANYWHERE in the field values of one field in another table.
Here's what I have so far:
This works, except that it's backward. It returns records where the ONLY data in table1.description = table2.sidnumber.
I want to find all the records where table2.sidnumber appears ANYwhere in table1.description. I've tried reversing the select without success.
Any help all very much appreciated!
Best,
Lee.
SQL Server 2005. I have a query where I want to see if any of the values of one field in one table appear ANYWHERE in the field values of one field in another table.
Here's what I have so far:
Code:
select id, idnumber from table1
where cast(description as varchar) in (select sidnumber from table2)
This works, except that it's backward. It returns records where the ONLY data in table1.description = table2.sidnumber.
I want to find all the records where table2.sidnumber appears ANYwhere in table1.description. I've tried reversing the select without success.
Any help all very much appreciated!
Best,
Lee.