MYSQL 循环语句

(select 
case 
bq.registration_type 
when 1 then '国有'
when 2 then '民营'
when 3 then '外资'
else ''
end as '注册类型',
bqr.revenue as '营收',
'' as '总资产'
from bigdata_qiye bq 
left join bigdata_qiye_report bqr
on bqr.qiye_id = bq.id) 

union all

(select 
case 
bq.registration_type 
when 1 then '国有'
when 2 then '民营'
when 3 then '外资'
else ''
end as '注册类型',
'' as '营收',
btii.total_input as '总资产'
from bigdata_qiye bq 
left join bigdata_tech_improve_impl btii
on btii.qiye_id = bq.id) 

 

posted @ 2023-07-27 06:54  myrj  阅读(23)  评论(0编辑  收藏  举报