gpt4 book ai didi

mysql - 计算前一天的日期

转载 作者:行者123 更新时间:2023-11-29 22:12:17 30 4
gpt4 key购买 nike

我试图总结表中字段的值,但是条件之一是日期必须是前一天的,我尝试使用 sql curdate() 但到目前为止我无法获取它上类:

string varsql = "SELECT  sum(merc1)/2 as total 
FROM wgcdoccab
where tipodoc ='FSS'
and serie='1'
and contribuinte='999999990'
and SELECT DATE_ADD(CURDATE(), INTERVAL -1 DAY);"; //division query

最佳答案

SELECT sum(merc1)/2 as total 
FROM wgcdoccab
where tipodoc ='FSS'
and serie='1'
and contribuinte='999999990'
and date_column = CURDATE() - INTERVAL 1 DAY

关于mysql - 计算前一天的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31517612/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com