order by case
when name LIKE "%John%" then 1
when name LIKE "%Doe%" then 2
else 3
end
More Related Contents:
- How does MySQL process ORDER BY and LIMIT in a query?
- Ordering by the order of values in a SQL IN() clause
- How can I search (case-insensitive) in a column using LIKE wildcard?
- Ordering by specific field value first
- MySQL “Group By” and “Order By”
- Using union and order by clause in mysql
- SQL order string as number
- MySQL Like multiple values
- MySQL order by “best match”
- Order by COUNT per value
- MySQL/MariaDB – order by inside subquery
- Sort the rows according to the order specified in WHERE IN clause
- how to use a like with a join in sql?
- How do you force mysql LIKE to be case sensitive? [duplicate]
- ORDER BY alphabet first then follow by number
- MYSQL Select One Random record from each Category
- Recreating a query using INNER JOIN? [duplicate]
- Create a Cumulative Sum Column in MySQL
- Equivalent of explode() to work with strings in MySQL
- MySQL “WITH” clause
- mysql select dynamic row values as column names, another column as value
- SQL – IF EXISTS UPDATE ELSE INSERT INTO
- Simple Random Samples from a Sql database
- How do I use properly CASE..WHEN in MySQL
- Delete query not working in mysql
- How to insert data to MySQL with auto-incremented column(field)?
- mysql like performance boost
- MySQL 5.6 – DENSE_RANK like functionality without Order By
- DELETE FROM `table` AS `alias` … WHERE `alias`.`column` … why syntax error?
- What happens when I exhaust a bigint generated key? How to handle it?