select sum(a.fee_value)
from ta a,tb b where a.service_type=b.service_type and b.fee_type=0