select 公司,"中层正职(权属企业)"
from (
SELECT
b.name 公司,
sum(CASE WHEN E.jobname = '中层正职(权属企业)' then 1 end) as "中层正职(权属企业)"
from bd_psndoc a
left join hi_psnjob c on a.pk_psndoc=c.pk_psndoc
left join om_job e on c.pk_job=e.pk_job
LEFT JOIN org_orgs b ON a.pk_org = b.pk_org
where jobname is not null
group by b.name
)
为啥要把字符串也改了
看截图明明是英文括号,私信怎么变成了中文括号。。
如果英文括号
select 公司,"中层正职(权属企业)"
from (
SELECT
b.name 公司,
sum(CASE WHEN E.jobname = '中层正职(权属企业)' then 1 end) as "中层正职(权属企业)"
from bd_psndoc a
left join hi_psnjob c on a.pk_psndoc=c.pk_psndoc
left join om_job e on c.pk_job=e.pk_job
LEFT JOIN org_orgs b ON a.pk_org = b.pk_org
where jobname is not null
group by b.name
)