I'm new to PostgreSQL (I have been using MS SQL for many years) and need to convert a numeric column which contains a time in seconds to HH:MM:SS format.
I have Googled and found that to_char(interval '1000s', 'HH24:MI:SS')
works so I am attempting to use this with my field name:
to_char(fieldname, 'HH24:MI:SS')
gives an error cannot use "S" and "PL"/"MI"/"SG"/"PR" together
to_char(fieldname::interval, 'HH24:MI:SS')
gives an error cannot cast type numeric to interval
Can anyone show me where I am going wrong?