I want to fetch count from table per day but the time column is in long so I can not just simply group by time column. I have to group by date in time column. How can I do this?
Table:
Column | type
----------------
id | Long (bigint)
name | String (varchar)
time | Long (bigint)
I have try following query but it doesn’t work as I have time in long and I want to group by date.
select time,count(*) from my_table mt group by time;
How can I group by date in above query?
One more thing I’m going to use this query in hibernate so need a query that can also be written in hql.
First of all we will convert our timestamp to date and then group by date!
hoping this will work. cheer 🙂