码迷,mamicode.com
首页 > 数据库 > 详细

mysql_crud

时间:2017-11-18 18:39:37      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:ase   from   col   class   price   highlight   else   多分支   mysq   

多分支查询

SELECT 
(CASE WHEN (marketprice > 0.1 and marketprice < 2) then marketprice + 1       
WHEN (marketprice > 2.1 and marketprice < 5) then marketprice + 3  
WHEN (marketprice > 5 and marketprice < 10) then marketprice + 5  
WHEN (marketprice > 10 and marketprice < 20) then marketprice + 10 
WHEN (marketprice > 20 and marketprice < 30) then marketprice + 18
WHEN (marketprice > 30 and marketprice < 50) then marketprice + 30   
WHEN (marketprice > 50 and marketprice < 100) then marketprice + 40  
else null end) AS  marketprice 
from ims_ewei_shop_goods;

  

mysql_crud

标签:ase   from   col   class   price   highlight   else   多分支   mysq   

原文地址:http://www.cnblogs.com/DLGD/p/7857439.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!