1:排序 (order)html
①: ->order('isread asc,createtime desc')mysql
②: $sort_conf['b_order.isread'] = 'asc'; // 正序
$sort_conf['b_order.createtime'] = 'desc'; // 降序sql
->order($sort_conf)curl
③:不等于:<>函数
④:等于null :is null ; 不等于null:is not nullurl
2:mysql-批量修改表字段中的某一部份内容spa
语法:update 数据表名 SET 字段名 = replac(字段名, '要替换的字符串', '替换为') wher 设定条件; code
update user SET picurl = replace(picurl, 'http://', 'https://') wher picurl is not null And ID < 200;
3:mysql中find_in_set()函数的使用htm
SELECT `id`,`tj_str` FROM `yk_user` WHERE find_in_set(id,'10013,10014,10015'); // 解决in很差解决不了的问题
SELECT `id`,`tj_str` FROM `yk_user` WHERE find_in_set('10012',tj_str); // 解决like很差解决的问题
find_in_set()和in的区别:https://www.cnblogs.com/xiaoxi/p/5889486.htmlblog
find_in_set()和like的区别:like是普遍的模糊匹配,字符串中没有分隔符,Find_IN_SET 是精确匹配,字段值以英文”,”分隔,Find_IN_SET查询的结果要小于like查询的结果。
四、MySQL两种存储引擎: MyISAM和InnoDB 简单总结:
① MyISAM不支持事务;InnoDB支持事务