
sql中case的用法
2个回答
展开全部
case 列 when 值1 then 值2 --当列的值等于值1 就返回值2
when 值3 then 值4 --当列的值等于值3 就返回值4
end
case when 列=值1 then 值2 --当列的值等于值1 就返回值2
when 列=值3 then值4 --当列的值等于值3 就返回值4
end
when 值3 then 值4 --当列的值等于值3 就返回值4
end
case when 列=值1 then 值2 --当列的值等于值1 就返回值2
when 列=值3 then值4 --当列的值等于值3 就返回值4
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询