SQL reverse LIKE SQL reverse LIKE sql sql

SQL reverse LIKE


You can use CHARINDEX for this.

Select * from countrywhere CHARINDEX(country.Name, 'Republic of Macedonia') > 0


Just reverse the operator (and fix the syntax)

Select * from countrywhere 'Republic of Macedonia' LIKE CONCAT('%',country.Name,'%')


For SQLite, a substring (mysubstring column) in a table (mytable) can be compared against an arbitrary larger test string:

select * from mytable where instr('Somewhere substring is here', mytable.mySubstring) > 0