1

I have this query:

SELECT hora FROM table;

I got "09:45:00"

Now, I'm trying to get the hour from that timestamp, and I'm trying:

SELECT TO_CHAR(hora,'HH24'), hora FROM table;

I was expecting: 9 | 09:45:00

But I got this error:

Undefined function: 7 ERROR: function doesn't exist to_char(character varying, unknown)

What I'm doing wrong?

pmiranda
  • 7,602
  • 14
  • 72
  • 155

1 Answers1

3
SELECT TO_CHAR('09:45:00'::time,'HH24') ;
Slumdog
  • 470
  • 2
  • 4