求个复杂的SQL语句,急

loveshrimp423 loveshrimp423 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
现有一个语句的查询结果是这样
语句
select c.voucher_no,b.title,b.wage_set_type,b.data_month,d.dept_id,a.emp_id,d.note_info,a.wage_subject_id,a.val from wage_set_val a,wage_set b,ebs_v c,wage_set_emp d where a.voucher_id =
b.voucher_id and b.voucher_id = c.voucher_id and c.voucher_id = d.voucher_id and a.emp_id=d.emp_id and b.data_month between '201001' and '201308' and d.dept_id in(select dept_id from
emp_dept where company_id in (select val from mup_user_bo where user_id='admin' and bo_id='emp_company'))
order by
c.voucher_no,b.title,b.wage_set_type,b.data_month,d.dept_id,a.emp_id,d.note_info,a.wage_subject_id
结果



要显示成横向的,要怎么改效果是下图


wage_subject_id,和val就是工资科目和金额
...全文

相关推荐

评论 17
收藏 已收藏
分享
返回顶部
loveshrimp423
应用实例 27,579 成员 68,540 内容