postgresql
The_Best_Hacker
天不生我李淳罡,剑道万古如长夜。
展开
-
序列:Sequence
create sequence timestamp_version start with 2 increment by 1 minvalue 1 maxvalue 99 cycle;解释:上面的sql语句意思是序列从2开始,每次自增1.最小值为1,最大值为99,当达到最大值进行循环。设置cucle属性后,当sequence达到最大值后,会循环从minValue开始。设置cycle属性后,如果没有指定MINVALUE的值,当sequence达到最大值时,.原创 2021-10-15 15:14:33 · 537 阅读 · 0 评论 -
pg返回到前端的json数据时间字段比北京时间早8小时
背景:SpringBoot+jpa+postgres问题描述:@ApiModelProperty(value = "记录创建时间")@CreationTimestamp@Temporal(TemporalType.TIMESTAMP)private Date createTime;使用上述代码自动sheng'c原创 2021-06-08 16:36:20 · 587 阅读 · 0 评论 -
Sql中的date以及timestamp
【sql】postgresql【异同】同:都是存储时间的类型异:date只能存储年月日;timestamp存储年月日时分秒原创 2020-09-23 11:18:06 · 1146 阅读 · 0 评论 -
sql多条件模糊查询之concat()&concat_ws()
【表单信息】【concat()函数】1.功能:将多个字符串连接成一个字符串。2.语法:concat(str1, str2,...)返回结果为连接参数产生的字符串,如果有任何一个参数为null,则返回值为null。如果中间有一行为null是因为task表中有一行的某个字段值为null。select concat(name,deadline,fund) as info from task;3.需求:模糊查询,字段name和fund中包含‘测试’student=#.原创 2020-08-24 12:46:04 · 1941 阅读 · 0 评论