选择不同的值,然后将其他结果分组 [英] selecting distinct values and then grouping other results

查看:65
本文介绍了选择不同的值,然后将其他结果分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个结果集,其中grp_ID列中有值,例如...



GRP_ID

------ -

2234

34

45

2234

34

2334

2342

2412

1244

i只想使用所有唯一值要添加的coressponding值与该id相关联

there is one result set where in grp_ID column has value such as...

GRP_ID
-------
2234
34
45
2234
34
2334
2342
2412
1244
i want to only all unique values to be used and coressponding values to be added ASSOCIATED WITH THE that id

推荐答案

select distinct grp_id将只给出其中一个。



要添加的同名值与该ID相关是什么意思?



如果你意味着您有其他列,并且您希望将这些列转换为每个单个ID的列表,然后这个 [ ^ ]是关于所有这些方法的文章。



如果你想要更多的帮助,我们需要更多的细节,特别是你要查询的表的结构,以及你希望最终输出看起来像什么
select distinct grp_id will give you only one of each.

What does "coressponding values to be added ASSOCIATED WITH THE that id" mean ?

If you mean that you have other columns and you want to turn those in to a list for each single id, then this[^] is my article on all the ways this can be done.

If you want more help, we need more detail, especially the structure of the table you're querying, and what you want the final output to look like


这篇关于选择不同的值,然后将其他结果分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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