I have two tables, both with the same structure. I want to select records from table 1 based on the values in table 2.
I have a field, thevalue, which contains values such as:
I have the query:
SELECT * FROM table1 where thevalue in(SELECT distinct concat('Like ''',left(rangeid,8),'%''') FROM table2)
when I run this query I don't get an error but 0 rows are returned. when I run the inner select statement separately it returns
Can anyone suggest how I can return the rows in table1 where the first 8 characters of the thevalue field match those in the thevalue field of table2?