What is the most straightforward way to pad empty dates in sql results (on either mysql or perl end)?

后端 未结 9 1697
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 06:12

I\'m building a quick csv from a mysql table with a query like:

select DATE(date),count(date) from table group by DATE(date) order by date asc;
9条回答
  •  囚心锁ツ
    2020-11-22 07:10

    Use some Perl module to do date calculations, like recommended DateTime or Time::Piece (core from 5.10). Just increment date and print date and 0 until date will match current.

提交回复
热议问题