Suppose I have a description column that contains
Column Description
------------------
I live in USA
I work as engineer
I have an other table containing the list of countries, since USA (country name) is mentioned in first row, I need that row.
In second case there is no country name so I don’t need that column.
Can you please clarify
You may want to try something like the following:
If you are using SQL Server, you should be able to use the
CHARINDEX()function instead ofINSTR(), which is available for MySQL and Oracle. You can also useLIKEas other answers have suggested.Test case:
Result: