Oracle 行转列函数

select E.EXPERT_ID_, E.COM_NAME_, E.EMP_NAME_, E.STATUS_, ER.PARENT_PRO_CODE_, wm_concat(ER.PRO_CODE_) as PRO_CODE_ from MP_EXPERT E left outer join MP_EXPERT_RELATION ER on ER.EXPERT_ID_ = E.EXPERT_ID_ group by E.EXPERT_ID_, E.COM_NAME_, E.EMP_NAME_, E.STATUS_, ER.PARENT_PRO_CODE_ having ER.PARENT_PRO_CODE_='动力';

转换前

转换后

wm_concat(列名),该函数可以把列值以","号分隔起来

转载于:https://www.cnblogs.com/mwd-banbo/p/10176034.html

你可能感兴趣的:(数据库)