使用示例1
将整数区间换为中文等:
select u.real_name,
u.id_card,
u.phone,
od.product_name,
od.progress,
od.score,
case
when od.score < 60 then '不合格'
when od.score >= 60 and od.score < 80 then '合格'
when od.score >= 80 then '优秀'
end '评分情况'
from order_detail od
join user u on u.user_id = od.user_id;
使用示例2
将整数一一对应地转化为中文:
select u.real_name '姓名',
u.id_card '身份证',
u.phone '手机号',
od.price '课程价格',
od.product_name '课程名称',
case op.payment_type
when 1 then '支付宝'
when 3 then '微信'
when 4 then '后台开课'
when 6 then '余额'
end '支付方式'
from order_pay op
join user u on u.user_id = op.user_id
join order_detail od on od.order_pay_id = op.order_pay_id