使用示例1

将整数区间换为中文等:

  1. select u.real_name,
  2. u.id_card,
  3. u.phone,
  4. od.product_name,
  5. od.progress,
  6. od.score,
  7. case
  8. when od.score < 60 then '不合格'
  9. when od.score >= 60 and od.score < 80 then '合格'
  10. when od.score >= 80 then '优秀'
  11. end '评分情况'
  12. from order_detail od
  13. join user u on u.user_id = od.user_id;

使用示例2

将整数一一对应地转化为中文:

  1. select u.real_name '姓名',
  2. u.id_card '身份证',
  3. u.phone '手机号',
  4. od.price '课程价格',
  5. od.product_name '课程名称',
  6. case op.payment_type
  7. when 1 then '支付宝'
  8. when 3 then '微信'
  9. when 4 then '后台开课'
  10. when 6 then '余额'
  11. end '支付方式'
  12. from order_pay op
  13. join user u on u.user_id = op.user_id
  14. join order_detail od on od.order_pay_id = op.order_pay_id