dimanche 8 novembre 2015

Query SQL databases

I am trying to make an android application with a database. But I have not much experience. I would like some help to make query to my database. My table "crisis" is as follows:

ID  StartDate             EndDate
1   2014-11-05 19:26:16   2014-11-05 19:26:46
2   2014-11-05 19:33:33   2014-11-05 19:33:43
3   2014-11-05 19:33:53   2014-11-06 19:35:14
4   2014-11-06 19:35:24   2014-11-06 19:35:54
5   2014-10-07 09:12:00   2014-10-07 09:12:34
6   2014-10-07 09:18:08   2014-10-07 09:19:11
7   2014-12-05 08:12:12   2014-12-06 08:13:11
8   2014-12-12 10:12:00   2014-12-12 10:12:26
9   2014-12-13 07:33:22   2014-12-13 07:33:59

Now I'd like to know how can I do to have the number of "crisis" a day, a month or even a year. For example the number of daily crisis:

Days        NumberOfCrisis
2014-11-05  3
2014-11-06  1

I am also having the average duration of attacks per day, week and even year. Please, any help would be much appreciated. Thanks a lot

Aucun commentaire:

Enregistrer un commentaire