a494567309 2016-03-14 10:12 采纳率: 50%
浏览 2644

sql把多条结果显示成一条

图片说明

目前的结果如图显示

我要显示成这样的

图片说明

2行合并成一行 貌似不需要分组 不用 wm concat 这个函数(记不清了)

我的sql 如下:

 select t.displayname||':' || h.parametervalue as 折扣
  from his_productordericb h
left join   ICBPATTERNPARAMETER   t
on h.icbpatternparameterid=t.icbpatternparameterid
 where h.productorderratepolicyid in
       (select  n.productorderratepolicyid new_id
          from (select 
                       b.productorderid,
                       a.rateplanid,
                       c.description
                  from ProductSpecRatePlanAssoc a
                  left join his_productorder b
                    on b.productspecid = a.productspecid
                  left join rateplan c
                    on a.rateplanid = c.rateplanid
                 where a.productspecid = b.productspecid
                   and a.rateplanid = c.rateplanid
                   and c.rateplanid in (525,
                                        526,
                                        527,
                                        528,
                                        529,
                                        530,
                                        531,
                                        532,
                                        991,
                                        992,
                                        993,
                                        994,
                                        995,
                                        996,
                                        997,
                                        998)
                   and b.productorderid = '8684231') m
          left join his_productorderratepolicy n
            on m.rateplanid = n.rateplanid
           and m.productorderid = n.productorderid
           and n.action = 1)

谢谢大家

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-03-14 14:49
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器