order by 指定顺序 mysql
时间:2015-05-19 12:53:07
收藏:0
阅读:308
LOCATE(substr,str), LOCATE(substr,str,pos)
第一个语法返回字符串str第一次出现的子串SUBSTR的位置。第二个语法返回第一次出现在字符串str的子串SUBSTR的位置,从位置pos开始。 SUBSTR不在str中,则返回0。
例子
select * from esp_order WHERE is_deleted="N" AND user_id= 1 ORDER BY locate(`status`,‘A,G,C‘)
原文:http://www.cnblogs.com/youngjoy/p/4514141.html
评论(0)