2017年11月23日

mysql IF语句使用

摘要: 类似于三元运算符 1) IF(where,result1,result2) = where?result1:result2 例如 SELECT IF(1=1,1,2) => 1 2) IFNULL(result1,result2) = result1 is not null?result1:resu 阅读全文

posted @ 2017-11-23 09:53 彩洋威 阅读(12600) 评论(1) 推荐(1) 编辑

mysql中文排序

摘要: mysql中英文或数组的排序时,不用关注数据库、表、字段的编码格式,直接使用 order by colName (asc|desc) 就可以完成 但是如果字段中含有中文字符,并且是以中文字符开头或是中文字符会影响到字符排序,就需要根据字段数据库中对应字段的编码格式选择合适的排序方式了, 编码格式为 阅读全文

posted @ 2017-11-23 09:41 彩洋威 阅读(371) 评论(0) 推荐(0) 编辑

导航