问题标签 [string-aggregation]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3981 浏览

sql-server - 在 SQL Server 的列中输出逗号分隔的列表

可能重复:
在 SQL Server 2005 中模拟 group_concat MySQL 函数?

实现这一目标的最佳方法是什么?编辑:在 MSSQL 2005

桌子

询问:

所以输出是:

0 投票
4 回答
15126 浏览

sql - Oracle 用逗号连接列

可能重复:
如何在 Oracle 中将多行组合成逗号分隔的列表?

有人可以告诉我如何实现以下目标吗?

桌子:

我的预期输出:

我是甲骨文的初学者,所以不知道该怎么做。任何帮助,将不胜感激。

谢谢

0 投票
1 回答
803 浏览

oracle - 将数据从多列显示到单行

在我的 oracle 数据库中包含以下数据

http://i1207.photobucket.com/albums/bb476/daniwarrior/data-awal.jpg

我想显示如下所示的数据

http://i1207.photobucket.com/albums/bb476/daniwarrior/data-aKHIR.jpg

白名单列正在合并 whitelist_pembayaran 列、whitelist_pemasan 和 whitelist_jenis_iklan

黑名单列正在合并blacklist_pembayaran 列、blacklist_pemasang 和 blacklist_jenis_iklan

oracle中的查询是否可以做?如果您可以如何查询以显示如上图所示的数据

* )对不起,我不能显示图片,因为我的声誉不太能够显示图像,所以我提供了图片的链接

0 投票
3 回答
22670 浏览

sql - 'stuff' 和 'for xml path('')' 来自 Postgresql 中的 SQL Server

我正在将一些 SQL Server 2008R2 查询迁移到 Postgresql 9.0,但遇到了一些问题。这是 SQL Server 查询:

阅读 SQL Server 文档我知道这会创建一个逗号分隔的列表。我认为我可以将stuff函数更改为overlay在 Postresql 中运行。我对么?

第二个问题来自带有for xml path('') 作为参数的 SQL Server。它返回分配给名为pNAMES而不是创建行元素的属性的值。那是对的吗?

Query_to_xml()具有属性的Postgresql 函数是否tableforest = 'true'相同?

谢谢你。

0 投票
2 回答
3240 浏览

sql - 如何在 PL/SQL 中查找字符串中不同字符的计数和名称

我对 PL/SQL 很陌生,我需要获取字符串中不同字符的名称和计数。例如,如果我有一个字符串str="helloexample",我需要得到不同字符的输出str,即heloxamp

我怎样才能做到这一点?

0 投票
3 回答
217 浏览

sql - 如何在 PLSQL 中获取分组输出

我有两张桌子:

我想从两个表中选择,我想得到输出:

如何获得上述输出。

0 投票
3 回答
929 浏览

sql - 如果第一列值相同,则连接第二列值

我有一个如下查询并列出了它的输出:

o/p:

我想重新编写查询,以便得到这样的输出:

谁能帮忙?

0 投票
1 回答
85 浏览

sql - Concatenating fields when BREAK ON command is used

I have built a command that uses the BREAK ON command to stop the output of duplicate field names. For example:

becomes:

Is there any way to have this output as:

In some instances the f.name field with have over 20 f.values associated with it.

The output will eventually be used to import into other places so I am trying to make the output as friendly as possible.

0 投票
1 回答
366 浏览

sql - Oracle SQL group by queries, Kind of PIVOT

Till now i haven't got a need to post a query, almost everything is available. This is my first question.

I have a different requirement, I have the below table name say alarmdb

------------------INT_ID----------------------------------------------------- ALARM_NUMBER----------------------------

Basically its kind of grouping, and pivoting. Final output can be like this.

------------------INT_ID----------------------------------------------------- ALARM_NUMBER----------------------------

Kind of shrinking many cells data into one.

Can anyone please suggest.

0 投票
1 回答
2795 浏览

sql - SQL Server 2000 等效的 GROUP_CONCAT 函数

我尝试GROUP_CONCAT在 SQL Server 2000 中使用该函数,但它返回错误:

'group_concat' 不是可识别的函数名”

group_concat所以我猜SQL Server 2000 中还有其他功能?你能告诉我它是什么吗?