来自于四明山的码农

 

oracle合并语句

在sql server中的合并语句可以用xml path

详见http://www.cnblogs.com/codeyu/archive/2010/05/25/1743474.html

而oracle的合并可以用 listagg配合within group

select * from (
select groupvalue,max(sendtime) as sendtime,
listagg(content) within group (order by sort) as content from messages a
group by groupvalue
) order by sendtime desc

 

还可以用这一句

select wm_concat(content) from messages

合并短信的内容

 

posted on 2014-03-27 16:50  技术先锋  阅读(327)  评论(0编辑  收藏  举报

导航