postgresql 拾遗

postgresql 拾遗,第1张

概述1. 从timestamp提取date和time to extract date from coldate, SELECT date(coldate) FROM mytable; to extract time, doing time(coldate) will give an error instead, SELECT "time"(coldate) FROM mytable another w

1. 从timestamp提取date和time

to extract date from coldate,

SELECT date(coldate) FROM mytable;

to extract time,doing time(coldate) will give an error instead,Fixed">
SELECT "time"(coldate) FROM mytable

another way

SELECT coldate::time FROM mytable


2.string to timestamp

to_timestamp(timestring,format)

to_timestamp('15:33:33','HH24:MI:SS)

select to_timestamp('2011-12-30 00:30:00','YYYY-MM-DD HH24:MI:SS')::timestamp without time zone;


3. 字符串连接

‘string1’ || ‘string2’

总结

以上是内存溢出为你收集整理的postgresql 拾遗全部内容,希望文章能够帮你解决postgresql 拾遗所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/1177552.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存