type conversion? - Mailing list pgsql-sql

From Peter Atkins
Subject type conversion?
Date
Msg-id 02E689F991FFD311A75D009027B6A73E0886EAC7@corp_mail01.sf.nextcard.com
Whole thread Raw
Responses Re: type conversion?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List 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


pgsql-sql by date:

Previous
From: Roberto Mello
Date:
Subject: Re: Hierarchical Queries
Next
From: Jean-Luc Lachance
Date:
Subject: Re: type conversion?