I have a table with a column ctime
of type time without time zone
.
| cdate | ctime
+------------+----------
| 2016-12-24 | 12:02:17
| 2016-12-24 | 12:02:32
| 2016-12-24 | 12:03:00
| 2016-12-24 | 12:02:10
I would like to group by both cdate
and ctime
but would like for ctime
to count only hours.
group by cdate, hour(ctime)
.group by cdate, hour(ctime)
gives meNo function matches the given name and argument types. You might need to add explicit type casts.
extract(hour from ctime)
is the ANSI SQL way to get the hour part. Perhaps works bettter?hour()
function in Postgres