type conversion?

Поиск
Список
Период
Сортировка
От Peter Atkins
Тема type conversion?
Дата
Msg-id 02E689F991FFD311A75D009027B6A73E0886EAC7@corp_mail01.sf.nextcard.com
обсуждение исходный текст
Ответы Re: type conversion?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список 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 по дате отправления:

Предыдущее
От: Roberto Mello
Дата:
Сообщение: Re: Hierarchical Queries
Следующее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: type conversion?