惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
WordPress大学
WordPress大学
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
博客园 - Franky
D
Docker
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
U
Unit 42
M
MIT News - Artificial intelligence
B
Blog
GbyAI
GbyAI
C
Check Point Blog
P
Proofpoint News Feed
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
IT之家
IT之家
Google DeepMind News
Google DeepMind News
V
V2EX
Stack Overflow Blog
Stack Overflow Blog

博客园 - James

Send-only Mail Server with Exim on Ubuntu 10.04 LTS Change hostname on Ubuntu without reboot 51IT最全的自动化测试工具QTP资料 QTP如何启动应用程序(转) - James - 博客园 找出用户表中有重复密码的用户 如何改变Linux Kennel中的shmmax参数 如何在C语言中使用constructor和destructor,gcc环境 如何在Ubuntu上update gem for ruby 1.9.1的版本 google疯了 - James - 博客园 碰巧遇到一些智力面试题,解答一下 避免在电脑上浪费时间的好办法 用RJS写的检测用户名和email是否存在 ajax check username available in rails MSN Messager密码 - James - 博客园 重新开始Blog生活 准备用C#写一个Blog的客户端,大家看看功能缺哪些,哪些不需要? PInvoke 白话文 Apache 2 + PHP Windows安装指南(官方版本) .Text Blog .95中一个Unicode的bug - James
如何在Postgresql中产生自己的集合function
James · 2010-05-18 · via 博客园 - James

CREATE FUNCTION join_two_with_comma(texttextRETURNS text
    LANGUAGE sql
    
AS $_$
    
SELECT CASE
        
WHEN $2 IS NULL OR $2 = '' THEN $1
        
WHEN $1 IS NULL OR $1 = '' THEN $2
        
ELSE $1 || '' || $2
    
END
$_$;
CREATE AGGREGATE join_with_comma(text) (
    SFUNC 
= join_two_with_comma,
    STYPE 
= text,
    INITCOND 
= ''
);

posted @ 2010-05-18 08:05  James  阅读(209)  评论(0)    收藏  举报