我有一個MySQL select語句並希望將其作爲一個查詢。MySQL中的SQL排序
select * from users where...
where子句將有四個部分,他們需要訂購這種方式:
1. where description = "query"
2. where description = "%query%"
3. where description = "q1" or description = "q2"
4. where description = "%q1%" or description = "%q2%"
這個問題類似:http://stackoverflow.com/questions/396748/ordering-by-the-order-of-values-in-a-sql-in-clause使用域,在給定的鏈接 – 2011-05-26 06:27:15
該字段如何工作? – cdub 2011-05-26 06:38:10
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field – 2011-05-26 06:39:34