0
的数据已经从具有一个至5月关系两个表取出转换行列。
查询:
select temp1.code, temp1.name, temp_dt.item_type,
(select item_name from pr_payroll_item where xid = temp_dt.payroll_item_xid
),
temp_dt.amount from pr_template temp1, pr_template_detail temp_dt
where temp1.xid = temp_dt.parent_xid;
Item Type
0 ear
1 add
2 ded
我有我如何能做到这一点Postgres里以这种方式与MH01 显示数据
code name ear value add value ded value
001 Nav BASIC 1000.00 HR 600.00 PF 50.00
FUEL 200.00
Mobile 300.00
同为其他名称为 “我”?实现这个结果集的查询应该是什么。
我不会说换行符。基本上我有一些记录下的item_type 0(这成为列1命名为耳朵,我需要显示的数额与列值相比)。同样,我有记录item_type 1命名为添加我需要显示值等等)。所以我显示的结果集在1个主记录下有6个子记录。 –