首页 > 其他 > 详细

case when then 根据不同条件 查询不同的数据 相当于 if-else if-else

时间:2017-07-27 15:14:47      阅读:615      评论:0      收藏:0      [点我收藏+]

Case when a=xx then ‘xx’ when a=’zz’ then ‘zz’ else ‘cc’ end as 别名
相当于 if-else if-else
case when bid.bid_stage=1 then ‘招标阶段‘ when bid.bid_stage=2 then ‘中标阶段‘ else ‘‘ end as bid_stage

case when then 根据不同条件 查询不同的数据 相当于 if-else if-else

原文:http://www.cnblogs.com/wcnwcn/p/7244812.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!