1. 按照既定顺序查询
$str = '3,6,4,1, 7, 8, 9, 11, 12, 13, 14, 24, 29, 30, 46,51';
$exp = new \think\Db\Expression('field(type_id,' . $str . ')');
order ($exp)
2.修改某一个字段 将该字段拼接一段字符串 并拼接另一字段值
UPDATE users SET `user_remark` = CONCAT_WS('',user_remark,'--重置-',user_tel),
3.查询两个表 相同字段
SELECT a.* FROM users as a,users_yzg as b where a.phone= b.phone
4.查询重复语句
Select *,count(*) From users Group By a,b,cHaving Count(*)>1
清除重复语句
delete from users where id in (select t.id from (Select id From users By a,b,cHaving Count(*)>1) t )