Пример моей таблицы авторов выглядит следующим образом:
Код: Выделить всё
+---------+-------------+
| id | author |
+---------+-------------+
| 1 | JK Rowling |
+---------+-------------+
| 2 | J.K Rowling |
+---------+-------------+
| 3 | Rowling JK |
+---------+-------------+
| 4 | Rowling J.K |
+---------+-------------+
| 5 | JK. Rowling |
+---------+-------------+
| 6 | Jim Jones |
+---------+-------------+
Код: Выделить всё
SELECT *
FROM `authors`
WHERE `author` LIKE '%J.K Rowling%'
Код: Выделить всё
SELECT *
FROM `authors`
WHERE `author` LIKE 'J.K Rowling%'
Код: Выделить всё
SELECT *
FROM `authors`
WHERE `author` LIKE '%J.K Rowling'
How should I structure the query in order to return similar authors.
Thanks
Подробнее здесь: https://stackoverflow.com/questions/438 ... g-contains
Мобильная версия