INSERT INTO runwa(rshottime,rmoney,renamecount) VALUES (CURDATE(),(select SUM(MONEY)  from income where  CREATESHOTTIME = CURDATE()),(select count(distinct hostname) from income where  CREATESHOTTIME = CURDATE()));

 

1.查询某张表 一个字段的总和。(select SUM(MONEY) from income

2.MYSQL里当天的时间(CURDATE())

3.查询某张表某个字段不同的值的数量。(select count(distinct hostname) from income)

相关文章:

  • 2021-10-27
  • 2021-08-03
猜你喜欢
  • 2021-04-17
  • 2021-07-08
  • 2022-12-23
  • 2022-01-31
  • 2021-08-02
  • 2022-01-18
  • 2021-12-08
相关资源
相似解决方案