oracle PL/SQL裏給字段起別名

  select   case TianQi
when 1 then '晴天'
when 2 then '陰天'
when 3 then '小雨'

end as "別名"
from tb

--上句中的給字段起別名,能夠是end 別名,能夠是end as 別名,也能夠是as "別名",使用MSSQLSERVER的用戶可要當心了,不支持單引號哦,因此不要寫成 end as '別名'
 
相關文章
相關標籤/搜索