I have MYSQL query that looks as below
select * from table1 where host REGEXP 'host1';
I want to execute the same query using LIKE
Please suggest how it can be achieved
Try this:
select * from table1 where host LIKE '%host1%';
REGEXP 'host1' will match host1 anywhere in the string. To phrase this using the LIKE operator we need to surround host1 with wildcards.