加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PostgreSQL中date数据类型

发布时间:2020-12-13 16:37:45 所属栏目:百科 来源:网络整理
导读:highgo=# create table test_aa (c1 date);CREATE TABLEhighgo=# insert into test_aa values (to_date('2018-06-05 19:55:44','yyyy-mm-dd hh24:mi:ss'));INSERT 0 1highgo=# insert into test_aa values (to_date('2018-06-05 03:55:44','yyyy-mm-dd hh24:
highgo=# create table test_aa (c1 date);
CREATE TABLE
highgo=# insert into test_aa values (to_date('2018-06-05 19:55:44','yyyy-mm-dd hh24:mi:ss'));
INSERT 0 1
highgo=# insert into test_aa values (to_date('2018-06-05 03:55:44','yyyy-mm-dd hh24:mi:ss'));
INSERT 0 1
highgo=# insert into test_aa values (to_date('2018-06-06 13:55:44','yyyy-mm-dd hh24:mi:ss'));
INSERT 0 1
highgo=# select * from test_aa;
     c1     
------------
 2018-06-05
 2018-06-05
 2018-06-06
(3 rows)


highgo=#
结论: pg中的date数据类型是指年-月-日,不包括时-分-秒 oracle中的date数据类型是指"年-月-日 时-分-秒"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读