[pgsql-jp: 25659] time型データの表示
吉塚 陽子
yoshizuka.wakaba @ nikon.co.jp
2002年 4月 23日 (火) 14:49:27 JST
お世話になっております。吉塚と申します。
またまた初歩的な質問で恐縮です。
以下のような表があるとします。
CREATE TABLE hoge
(
id int,
day date,
start time
)
これを以下のように表示させるには、time型データをどのようにしたらよいのでしょ
うか?
id day start
------------------------------
10 2002年4月23日 10時30分
select id, to_char(day,'YYYY年MM月DD日') as day,
to_char(start,'HH24時MI分') as start from hoge where id=10 ;
とエラーになってしまいます。
ERROR: Function 'to_char(time, unknown)' does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts
to_char関数では、timestampしか指定できないのでしょうか?
http://osb.sra.co.jp/PostgreSQL/Manual/PostgreSQL-7.1-ja/functions-formattin
g.html
や
http://osb.sra.co.jp/PostgreSQL/Manual/PostgreSQL-7.1-ja/functions-datetime.
html
あたりを見ても、そういう使い方は乗ってないような…。
よろしくお願いします。
pgsql-jp メーリングリストの案内