![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
postGre
chenchenchenchenyi
这个作者很懒,什么都没留下…
展开
-
relation “XXX.XXX_id_seq“ does not exist 的解决办法
Postgre数据库创建和修改序列原创 2022-06-07 16:34:49 · 5096 阅读 · 1 评论 -
postgresql 分组排序后获取组内第一条数据
select *from ( select row_number() over (partition by code order by id asc) rowId,* from xx.xx p ) twhere rowId = 1按code进行分区,id正序原创 2021-08-31 17:07:00 · 4313 阅读 · 0 评论 -
postgre 联表更新
postgre 联表更新UPDATE skema.t1as t1SET t1_name= t2.t2_nameFROM skema.t2 as t2WHERE t1.id= t2.idAND t2.t2_name= 'XXX'原创 2021-04-30 11:01:44 · 215 阅读 · 0 评论 -
postgre 实现 group_concat
mysql中有group_concat聚集函数,与group by一起使用。按某个字段的分组将分组中特定列的值拼成字符串。select group_concat(name) from student group by class;/*按班级号分组,将同一个班的学生姓名拼起来,用逗号间隔*/postgre没有现成的group_concat函数,只能自定义:CREATE AGGREGATE group_concat(anyelement)(sfunc = array_append, -- 每原创 2020-10-28 10:30:32 · 1221 阅读 · 0 评论