Query for similar phrases

Mihaela :

Is there any way to match 'United States of America' with 'United States' in SQL?

I have the country with the name 'United States' stored in the database. The query below should retrieve the item from the database with the name 'United States'.

SELECT * FROM `countries` WHERE `name` LIKE '%United States of America%'

Thank you!

Gordon Linoff :

Is this what you want?

where 'United States of America' like concat('%', name, '%')

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=8624&siteId=1