mssql:
select xx.id,评价=case
when name='a' then '优秀'
when name='b' then '良好'
else '一般'
end
from xx
mysql:
select total,case
when total>0 then '浪费'
else '节约' end as '评价'
from month
mssql:
select xx.id,评价=case
when name='a' then '优秀'
when name='b' then '良好'
else '一般'
end
from xx
mysql:
select total,case
when total>0 then '浪费'
else '节约' end as '评价'
from month