场景:salordersettlement 中 与 comdictinfo 一对多关系,将其中的多个付款方法进行拼接。
oracel实现:
select listagg((select c.langname1 from comdictinfo c where c.dicticode='271506'and c.code=t.paymode),',') within group(order by 1) as paymodes from salordersettlement t where t.salordicode=:salordicode
mysql实现:
select id,group_concat(product separator ',') from orders group by id;