alter table tb_safety_commitment add constraint uk_ma编程客栈c_vendor unique (company_code,promise_date);
补充:一行数据中的 多字段值根据连接符拼接
concat_ws(':',a,b)
几行数据中的 同一 单字段值根据连接符拼接
string_agg(c,' \r\n ')
如果要将多个字cQrhSEyk段的值拼接成http://www.cppcns.com一个:
string_agg(concat_编程客栈ws(':',a,b),' \r\n ' order by a asc) as xxx
结果:
还可以对进行排序
例子:
string_agg(concat_ws('|',login_name,user_name),',') as jcry,
返回结果:
以上为个人经验,希望能给大家www.cppcns.com一个参考,也希望大家多多支持我们。如有错误或未考虑完全的地方,望不吝赐教。
本文标题: postgresql数据添加两个字段联合唯一的操作
本文地址: http://www.cppcns.com/shujuku/postgresql/376192.html
© 著作权归作者所有
举报
发表评论
0/200