postgre函数整理

postgre 函数整理

COALESCE

COALESCE (expression_1, expression_2, ...,expression_n)依次参考各参数表达式,遇到非null值即停止并返回该值。如果所有的表达式都是空值,最终将返回一个空值。对于空值可以指定返回的默认值。

CONCAT

CONCAT(str1,str2,...)返回拼接参数的新字符串

string || string

字符串连接操作

md5(string)

对字符串md5加密

to_char

将日期、整数、浮点数等格式化为字符串

FunctionReturn TypeDescriptionExample
to_char(timestamptext)textconvert time stamp to stringto_char(current_timestamp, 'HH12:MI:SS')
to_char(intervaltext)textconvert interval to stringto_char(interval '15h 2m 12s', 'HH24:MI:SS')
to_char(inttext)textconvert integer to stringto_char(125, '999')
to_char(double precisiontext)textconvert real/double precision to stringto_char(125.8::real, '999D9')
to_char(numerictext)textconvert numeric to stringto_char(-125.8, '999D99S')
to_date(texttext)dateconvert string to dateto_date('05 Dec 2000', 'DD Mon YYYY')
to_number(texttext)numericconvert string to numericto_number('12,454.8-', '99G999D9S')
to_timestamp(texttext)timestamp with time zoneconvert string to time stampto_timestamp('05 Dec 2000', 'DD Mon YYYY')



  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值