替换/分配select语句中的值

时间:2011-11-02 08:06:58

标签: mysql sql

    select paymentType from paymentAccount


  output
  p
  f

如何显示输出

  output
  Part
  Full

1 个答案:

答案 0 :(得分:3)

重写如:

select CASE paymentType WHEN 'p' THEN 'Part' WHEN 'f' THEN 'Full' END AS paymentType from paymentAccount