matengfei123

update ptop_investrecord set delflag = 1 where cid  = 250 and uid = 92569  and delflag = 0 and progress = 1 and comefrom = \'5\' and ptopRecordId = \'253274\'
and id not in (select tmp.myid FROM (SELECT min(id) as myid from  ptop_investrecord as tmp where cid  = 250 and uid = 92569  and delflag = 0 and progress = 1 and comefrom = \'5\' and ptopRecordId = \'253274\') as tmp);

 

标红的一定要加,创建临时表,不然mysql报错  You can\'t specify target table \'user\' for update in FROM clause

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-02-12
  • 2021-04-01
  • 2021-12-18
  • 2021-09-07
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2021-12-07
  • 2022-01-19
  • 2021-11-26
  • 2021-08-20
  • 2022-12-23
相关资源
相似解决方案