代码:

// 在mysql5.6,运行正常,5.7报错
SELECT sum((
select a.num where a.status =1) ) as total FROM mes_order_product AS a LEFT JOIN mes_order AS b ON a.osn = b.osn

 

修改后的代码,增加了表明limit

// 5.6 和5.7运行都正常
SELECT sum((
select a.num from mes_order_product where a.status =1 limit 0,1)) as total FROM mes_order_product AS a LEFT JOIN mes_order AS b ON a.osn = b.osn

 

相关文章:

  • 2021-07-30
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-26
  • 2021-04-19
  • 2021-12-18
猜你喜欢
  • 2021-04-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
相关资源
相似解决方案