Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t_stamp | total_charge | count
- ---------------------+--------------+-------
- 2011-05-09 07:56:50 | 22650 | 1
- 2011-05-09 09:28:15 | 6450 | 1
- 2011-05-09 08:59:51 | 17850 | 1
- 2011-05-11 10:15:00 | 13050 | 1
- 2011-05-09 13:51:51 | 1950 | 1
- 2011-05-09 22:27:31 | 0 | 1
- 2011-05-09 23:47:58 | 29850 | 1
- 2011-05-10 09:17:33 | 150 | 1
- 2011-05-11 09:51:48 | 1350 | 1
- 2011-05-09 22:39:10 | 0 | 1
- 2011-05-09 15:31:07 | 0 | 1
- 2011-05-11 09:32:58 | 29400 | 1
- 2011-05-09 07:11:16 | 18750 | 1
- 2011-05-09 23:51:16 | 1650 | 1
- 2011-05-10 07:11:23 | 28650 | 1
- 2011-05-10 08:00:50 | 0 | 1
- 2011-05-10 17:02:39 | 25350 | 1
- 2011-05-09 22:06:13 | 5700 | 1
- 2011-05-09 22:47:59 | 0 | 1
- 2011-05-09 09:12:34 | 0 | 1
- 2011-05-10 09:00:13 | 4500 | 1
- 2011-05-09 22:26:59 | 0 | 1
- 2011-05-09 23:44:35 | 1800 | 1
- 2011-05-10 21:35:36 | 0 | 1
- 2011-05-09 15:12:13 | 2100 | 1
- 2011-05-10 09:07:28 | 15900 | 1
- 2011-05-09 15:28:22 | 8550 | 1
- 2011-05-10 15:40:19 | 10950 | 1
- question?
- how can i create a query that groups by the date?
- i want to have 'total_charge' according to date.
- here is my query
- select t_stamp, total_charge from mt.mt_batches where complete='t' and date(t_stamp) between 20110509 and 20110512;
- i have tried
- select date(t_stamp), sum(total_charge),count(*) from mt.mt_batches where complete='t' and date(t_stamp) between 20110509 and 20110512 group by date(t_stamp), total_charge;
- thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement