数据类型格式化函数
函数 | 返回类型 | 描述 | 例子 |
to_char(timestamp, text) | text | 把时间戳转成字符串 | to_char(current_timestamp, ‘HH12:MI:SS’) |
to_char(interval, text) | text | 把间隔转成字符串 | to_char(interval ‘15h 2m 12s’, ‘HH24:MI:SS’) |
to_char(int, text) | text | 把整数转成字符串 | to_char(125, ‘999’) |
to_char(double precision, text) | text | 把实数或双精度转成字符串 | to_char(125.8::real, ‘999D9’) |
to_char(numeric, text) | text | 把数字转成字符串 | to_char(-125.8, ‘999D99S’) |
to_date(text, text) | date | 把字符串转成日期 | to_date(‘05 Dec 2000’, ‘DD Mon YYYY’) |
to_number(text, text) | numeric | 把字符串转成数字 | to_number(‘12,454.8-’, ‘99G999D9S’) |
to_timestamp(text, text) | timestamp with time zone | 把字符串转成时间戳 | to_timestamp(‘05 Dec 2000’, ‘DD Mon YYYY’) |
关于AntDB数据库
电信级核心交易数据库AntDB 数据库始于 2008年,在运营商的核心系统上,为全国 24个省份的 10亿多用户提供在线服务;具备高性能、弹性扩展、高可靠等产品特性,每秒可处理十多万笔核心交易,并保障系统平稳运行超 10年零故障。 AntDB 广泛应用于通信、金融、交通、能源、物联网等多个行业,在 200多个项目上成功落地。




