I have a table that stores entries along with their timestamp. My node.js API should return both the count of rows and count of entries grouped by hour.
example:
{
"count":"6",
"countByHour":[
"00":"1",
"08":"2",
"16":"3"
]
}
What should be the SQL query to generate this result?