wm_concat使用方法的记载
- 需求:房产资料表存的是房产档案,合同表存有房产pk,但是显示是多行的,需要展现为一列name
- 效果如下 :
SELECT pk_house from fdc_pr_housePact where pk_head ='1002A11000000004NGEC'
SELECT fdc_pr_housepact.pk_head pk_head,
dbms_lob.substr ( wm_concat ( distinct fdc_crmbd_fangchanzhubiao.code ) ) vhcode,
dbms_lob.substr ( wm_concat ( distinct fdc_crmbd_fangchanzhubiao.name ) ) vhname,
SUM ( distinct fdc_crmbd_fangchanzhubiao.nbuildarea ) nbuildarea,
SUM ( distinct fdc_crmbd_fangchanzhubiao.ninarea ) ninarea
FROM fdc_pr_housePact
INNER JOIN fdc_crmbd_fangchanzhubiao
ON fdc_pr_housepact.pk_house = fdc_crmbd_fangchanzhubiao.pk_head
WHERE fdc_pr_housepact.pk_head ='1002A11000000004NGEC'
GROUP BY fdc_pr_housepact.pk_head