Having the following table schema:
id | english_name | russian_name | year
---------------------------------------
5 | The Book | Kniga | 2008
and the given input: Kniga 2008;
Is it possible to reproduce the following steps?
- Search
russian_namefor EXACT MATCH. If matched, return the row; - If no matches, search
english_namefor EXACT MATCHES. - If still no matches, like in the following case (input is
Kniga 2008), then try to look among columns and see if there is ANY COMBINATION of columns matched. In this particular caserussian_nameandyearwill match. - Ignore characters like
-,/,:so if the given input is:The Book / Kniga 2008or isThe Book : 2008, the results should still contain the row above.
It’s not pretty, but:
where the query string is set to the first two question marks, and the second and third as: