douzou8074 2014-01-19 19:13
浏览 9
已采纳

在MySQL行中创建一个NULL字段显示为值?

The only way I can think of doing this is with a bunch of If statements by carrying over the values. Does MySQL currently have a query function that can display a certain value (Lets say, MTNDEW) as another if it falls under the correct qualifications (If ["soda"] = MTNDEW then display it as Mountain_Dew)? Sorry if I'm not being clear, my English is not very good.

  • 写回答

1条回答 默认 最新

  • douweng3564 2014-01-19 19:20
    关注

    you want the mysql if function http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html#function_if

    SELECT IF(soda='MTNDEW','Mountain_Dew',' NOT Mountain_Dew');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?