select count(*) as inoutAll, sum( case when out_date is null then 1 else 0 end ) as inSum, sum( case when out_date is not null then 1 else 0 end ) as ouSum from bob_c_sec_user
假设离职日期字段为null表示未离职 select (select count(*) from zhigong where ruzhiriqi is not null and lizhiriq is null) as ruzhicount, (select count(*) from zhigong where lizhiriq is not null) as lizhicount