select Z,count(Z) 人数 from a
left join b on a.JL=b.bh
where Z is not null
group by Z
select floor((SYSDATE - to_date(birthday,‘yyyy-mm-dd’))/365) AS AGE from temp
select sex ,count(sex) 性别 from
(select (case sex
when ‘1’ then ‘男’
when ‘2’ then ‘女’
else '未知’end)as sex
from temp)t
group by sex
删除多个列
ALTER TABLE DWD_TEAC DROP (CREATETIME,UPDATETIME,GENERATORTIME);
删除表数据,留有结构列名
truncate table DWD_TEAC