monthly
-
[sqlite] weekly & month statistics queryFrontend/react-native 2019. 11. 8. 12:15
운동 기록 records에서 주간별 볼륨합을 구해서 그래프로 변화를 표현하고자 한다. (I'll calculate weekly & monthly volume sums and represent the changes in graph.) [Weekly] mysql: SELECT DATE_FORMAT(DATE_SUB(today, INTERVAL (DAYOFWEEK(today)-1) DAY), '%Y/%m/%d') as start, DATE_FORMAT(DATE_SUB(today, INTERVAL (DAYOFWEEK(today)-7) DAY), '%Y/%m/%d') as end, DATE_FORMAT(`today`, '%Y%U') AS `date`, sum(volume) as volume FROM records ..