天
1 | SELECT date_format( billGenerateTime, '%Y-%m-%d' ) FROM charge_record where date_format( billGenerateTime, '%Y-%m-%d' ) BETWEEN '2017-10-1' and '2019-12-31'; |
月
1 | SELECT date_format( billGenerateTime, '%Y-%m' ) FROM charge_record where date_format( billGenerateTime, '%Y-%m' ) BETWEEN '2017-10' and '2019-12'; |
年
1 | SELECT date_format( billGenerateTime, '%Y' ) FROM charge_record where date_format( billGenerateTime, '%Y' ) BETWEEN '2017' and '2019'; |