作为程序员一定要保持良好的睡眠,才能好编程

mysql函数汇总

发布时间:2016-05-25

mysql函数汇总:


mysql中判断是否包含某个字符串

locate(",",czproduct)  判断czproduct 中是否包含","这个字符。


e13.png


select id,htbianhao,czproduct from web_htorder where locate(",",czproduct)>0 and id >=526 order by id desc limit 10;

e12.png



left(str,2)

right(str,3)

substr(str,3); 截取字符字符串从str的第三位开始截取,到最后

substr(str,3,2)从str这个字符的第三位开始截取,截取2位