select ei.customerid, tg.customername, 
case ci.Cltype when '001' then ci.Linesum end as 基本授信额度,
case ci.Cltype when '007' then ci.Linesum end as 同业专项额度,
case ci.Cltype when '010' then ci.Linesum end as 项目型专项额度,
case ci.Cltype when '002' then ci.Linesum end as 非项目性专项额度
from 
cl_info ci right join ent_info ei on ci.customerid = ei.customerid  
right join tem_gj tg on ei.enterprisename = tg.customername 
group by ei.customerid, tg.customername, ci.Cltype,ci.Linesumcl_info 基表,额度表
ent_info 用于关联 tem_gj
tem_gj 存放需要显示额度的 客户    CUSTOMERID CUSTOMERNAME 基本授信额度 同业专项额度 项目型专项额度 非项目性专项额度
96 77379798X 南通吉运机械防腐设备有限公司 10000000
97 77379798X 南通吉运机械防腐设备有限公司
98 782054897 江苏港华船业有限公司                  58000000
99 782054897 江苏港华船业有限公司          15000000
100 783819855 南京太平洋磁业科技有限公司
101 783819855 南京太平洋磁业科技有限公司 10000000
102 698392965 南京长升机械工程有限公司
103 72869763X 泰州市华扬调速电机有限公司
104 753999963 众泰控股集团有限公司         50000000
105 753017464 浙江众泰汽车制造有限公司 60000000
106 753017464 浙江众泰汽车制造有限公司 50000000 我想要得到的结果:
南通吉运机械防腐设备有限公司 共两条记录,就显示有一条有值,没值的删除。 
江苏港华船业有限公司 共有两条记录,  同业专项额度,非项目性专项额度 数值 在一条中显示
南京长升机械工程有限公司 只有一条记录,保留空记录
浙江众泰汽车制造有限公司 两条记录都有值,都保留请高手提点,谢谢~