Mysql 条件判断
语法格式:
SELECT
NAME '英雄',
CASE NAME
WHEN '德莱文' THEN
'斧子'
WHEN '德玛西亚-盖伦' THEN
'大宝剑'
WHEN '暗夜猎手-VN' THEN
'弩'
ELSE
'无'
END '装备'
FROM
user_info;
例1:
select aa.*,
case a.mode_code
when 'AA08'
then MAX(a.information_num)
when 'AA06'
then MAX(a.information_num)
ELSE
SUM(a.information_num )
end information_num
from XXX

浙公网安备 33010602011771号