这个有点困难,只能写pro*c了.....
我有个费用表;其中charge里面包含优惠费用;现在想把优惠费用做为一个列;
根据acct_item_type_id帐目类型ID来分;
select a.*,b.charge
from bill_acct_item a,bill_acct_item b,bill_acct_item_type c,bill_acct_item_type d
where a.acct_item_type_id=c.acct_item_type_id and b.acct_item_type_id=d.acct_item_type_id
and substr(c.standard_code,1,1) between 0 and 9
and substr(d.standard_code,1,1) between 'A' and 'Z'
and substr(c.standard_code,2,5)=substr(d.standard_code,2,5)
A-Z代表优惠费用类型
0-9代表代表非优惠类型
|