SQL之case when then用法

--简单case函数
case sex
  when '1' then '男'
  when '2' then '女’
  else '其他' end


select ROW_NUMBER() OVER ( ORDER BY equipment_type, equipment_ip desc ) AS xuhao ,
[equipment_id], equipment_name ,

equipment_ip ,equipment_port,

case [equipment_type] 

when 'a' then 'b' 

when 'b' then 'c' when 'd' then 'e' 

end
as [equipment_type] 

from b
where status ='1'

原文地址:https://www.cnblogs.com/asdyzh/p/9743245.html