函数 | 返回类型 | 描述 | 例子 |
---|---|---|---|
to_char( |
text |
把时间戳转成字符串 | to_char(current_timestamp, 'HH12:MI:SS') |
to_char( |
text |
把间隔转成字符串 | to_char(interval '15h 2m 12s', 'HH24:MI:SS') |
to_char( |
text |
把整数转成字符串 | to_char(125, '999') |
|
text |
把实数或双精度转成字符串 | to_char(125.8::real, '999D9') |
to_char( |
text |
把数字转成字符串 | to_char(-125.8, '999D99S') |
to_date( |
date |
把字符串转成日期 | to_date('05 Dec 2000', 'DD Mon YYYY') |
to_number( |
numeric |
把字符串转成数字 | to_number('12,454.8-', '99G999D9S') |
to_timestamp( |
timestamp with time zone |
把字符串转成时间戳 | to_timestamp('05 Dec 2000', 'DD Mon YYYY') |
将字符串转换成double类型(to_number())
select count(*) as tt, sum(to_number( length, '999999.9999') ) as x, sum(to_number( area, '9999999.9999') ) as x from szt_road