Drkcore

12 05 2006 cdbi Tweet

CDBIで日ごとに集計をとりたいが、、、、

Class::DBIでMySQLのDatetime型を日付で集計ってどうやるんだろうか?

つまりはこういうことがやりたいんだけど。

mysql> select substring(subdate,1,10) as date,count(*)
mysql> from items group by date;
+------------+----------+
| date       | count(*) |
+------------+----------+
| 2006-04-26 |       15 |
| 2006-04-27 |        2 |
| 2006-05-01 |        5 |
| 2006-05-02 |        1 |
| 2006-05-09 |        2 |
| 2006-05-10 |        1 |
| 2006-05-11 |       37 |
| 2006-05-12 |        2 |
+------------+----------+

こいつを棒グラフとか折れ線グラフで画像に書き出してやろうと思ったんだけどナァ、、、、

やっぱset_sqlなのかな。

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021