1.mysql数字格式化加0
use test;
update table set Number=CONCAT(LPAD('0022',4,'0'),LPAD(EquipmentLotNum,4,'0'));
结果:Number=“00220004”
2.mysql插入新的字段
alter table `table1`
Add column State TINYINT not null default 3 AFTER `Name`
3.查询同一张表中同一用户相邻两行之间的时间差为几秒的数据
select *,count(*) as count from
(select ID,UserID,left(SelectTime,18) as diff from table1) a
group by UserId ,diff order by count desc