选择查询到一列列表中 [英] select query into list on one column

查看:91
本文介绍了选择查询到一列列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将所有ID都选择到一列中,并以逗号,

I am trying to select all id into one column and delimit it with a comma ,

我的数据列:

+---+--------+--------------+
|id |somedata|someother data|
+---+--------+--------------+
|1  |data1   |other1        |
+---+--------+--------------+
|2  |data2   |other2        |
+---+--------+--------------+
|3  |data3   |other3        |
+---+--------+--------------+

我想要做出的结果:

+-------+
|id list|
+-------+
|1, 2, 3|
+-------+

结果应该是名为"id list"的1列ID的列表.

The result should be a list of ID's in 1 column named 'id list'.

问题是,这可能吗?如何?我尝试搜索关键字sql query select into list和其他关键字,但是没有运气.

The question is, is this possible? and how? I tried searching for the keywords sql query select into list and other keywords but with no luck.

但是此查询基于嵌套选择.

But this query is on a nested select.

推荐答案

使用 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆