type conversion?

From: Peter Atkins <Peter(dot)Atkins(at)nextcard(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: type conversion?
Date: 2002-04-09 17:08:31
Message-ID: 02E689F991FFD311A75D009027B6A73E0886EAC7@corp_mail01.sf.nextcard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

All,

I have a column "total_hours | character varying(5) " and I am unable to
perform the aggrigate function SUM() because of the column type.
Without changing the type is there a way to convert the datatype by using
CAST(), to_char() or something simular? So that I may calculate the SUM().

SELECT SUM(total_hours) AS hours FROM my_table WHERE flag='$flag';

Thanks!
-p

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-04-09 17:48:09 Re: type conversion?
Previous Message Roberto Mello 2002-04-09 15:34:00 Re: Hierarchical Queries