当前位置: 代码迷 >> Oracle管理 >> 新人求教,有人來指點不!该怎么解决
  详细解决方案

新人求教,有人來指點不!该怎么解决

热度:135   发布时间:2016-04-24 04:16:18.0
新人求教,有人來指點不!!!!
Filed1 Filed2 Filed3 
a1 b1 c1
a1 b2 c2
a2 b3 c1
a2 b1 c2
a3 b3 c1
a3 b1 c2

想查出filed1中有相同filed3的数据 三个字段都得SHOW出来
比如:Filed3.c1 中有哪几个Filed1有



------解决方案--------------------
select field3,to_char(wmsys.wm_concat(field1)) field1 from table group by field3 order by field3

结果为
C1  a1,a2,a3
C2  a1,a2,a3
------解决方案--------------------

select * from table_name where filed3='c1';--这太简单了吧
--下面这个?
select filed1,filed2,filed3,count(filed1) over(partition by filed3) cnt from table_name 
--查看根据filed3分组的filed1个数及数据展示
  相关解决方案