The scenario is that i have implemented a search query using like operator:
.. WHERE caption LIKE 'hello%' OR text LIKE '%hello'
OR caption LIKE 'jame%' OR text LIKE 'jame%'
and the table is something similar to:
id | caption | text
---------------------
1 | Hi | Hi Jame
2 | Hello | Hello firend
3 | Jame | Hello jame
so i expect that result set to be order like this:
id | caption | text
---------------------
3 | Jame | Hello jame
1 | Hi | Hi Jame
2 | Hello | Hello firend
because 3rd row has more matches to WHERE
and LIKE
clauses.
Is there a way to do that ?