I have a table "AddressSearch". In one column I have stored a comma separated list of strings.
eg: Table: AddressSearch
col1
-----------------
UK, east, london
UK, Cambridge, Museum
Maryland, Johns University
I also have another table named "Main" which has a column "full_address" that stores the full addresses in the format "xxx, east london, UK, E15 xxx".
I need a way to find all occurrences in the "Main" table where full_address contains all the strings that are comma separated in each row in the AddressSearch table.
eg: For the first row in AddressSearch, it should match all the rows in Main and filter out the rows that contain "UK" AND "east" AND "London".
I have already tried to split the strings into a table variable and do an inner join between Main and AddressSearch with PATINDEX. But this will only give me rows from Main that has either "UK" OR "east" OR "London".
Any suggestions?