#以下是每次执行都初始化变量伪自增序列从0开始,不是从1开始自增
SELECT @rownum:=0 #以chinapostlocalregistry表增加流水号为例。 #insert into chinapostlocalregistry(number,Type,IsUsed,Created,UsedDate) select CONCAT('LAODD',DATE_FORMAT(now(),'%Y%m%d'),LPAD(@rownum:=@rownum+1,4,'0')),21,0,now(),NULL from chinapostlocalregistry

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-07
  • 2021-06-26
  • 2022-12-23
猜你喜欢
  • 2022-03-03
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-10-09
  • 2021-07-03
  • 2021-06-24
相关资源
相似解决方案