I am looking to run a a DB query where if a user queries with multiple sub-strings across two columns they can bey queried. For example,
Column 1 is Country Name and Column 2 is City and Country Name. Sample data:
Column1| Column2
USA | Portland, Oregon, United States of America
USA | Portland, Maine, United State of America
USA | Bellevue, Washington, United State of America
USA | Bellevue, Nebraska, United State of America
Now user can query using various option. For example:
Portland America
Portland USA
Portland Oregon USA
Portland Oregon America
Portland United States
... and so on
I am looking to build a query that can solve this for me. I tried the combination of where and orwhere but that didn't solve for it.
To elaborate further, the country name in column one can also be Republic of China. And the query can be random combination of either two words or strings from the same column or column1 and column2 combined. Or it can be just a single word.