mysql - SUM(quantity) 00:00 - 23.59 Yesterday -
based on how make interval entire day 00:00 - 23.59 ( yesterday )
select sum(quantity) downloads date>=current_date() , date<current_date() + interval '1' day
try it-
select sum(quantity) downloads date>=concat(subdate(curdate(), interval 1 day),' 00:00:00') , date<= concat(subdate(curdate(), interval 1 day),' 23:59:59')
or can use-
select sum(quantity) downloads date>=subdate(curdate(), interval 1 day) , date< curdate();
Comments
Post a Comment