jeudi 11 juin 2015

how to count sqlite data with datetime (ticks)

example table,

c1 |c2

635695990169762621 | 1

635695364719292817 | 1

635695392709649551 | 3

column c1 data type is numeric and save datetime as tick in this c1 colum).


how can get values from this table like this?

_date -> 2015-06-11 count -> 2

_date -> 2015-06-10 count -> 1

I just try this code. the n

select * from ( SELECT strftime('%Y-%m-%d',c1/10000000 - 62135596800,'unixepoch') as _startDate, count(strftime('%Y-%m-%d',c1/10000000 - 62135596800,'unixepoch')) as count from usertable ) group by strftime("%d", _startDate)

Aucun commentaire:

Enregistrer un commentaire