As I ask upon https://dba.stackexchange.com/q/338422/118215
I search in this table:
mytable:
---
id PK Biginteger Autoincrement
name varchar(255)
Like this:
select * from mytable where name like "%someval%";
And I want to sort my result using the closest match towards someval
. How I can do this?
Top comments (2)
If you were using a MySQL full search index with MATCH, maybe.
Here you are using "LIKE" so it's an exact match modulo the collation.
Maybe you could look around SOUNDEX.
But I'm unsure you will be able to sort then.