When using SELECT can you modify the value of a returned field based on other fields?

后端 未结 4 1827
梦毁少年i
梦毁少年i 2021-01-18 02:44

When using MySQL SELECT can you change the value of a returned field based on other fields?

For example, if I have this select:

SELECT city,state,cou         


        
4条回答
  •  不要未来只要你来
    2021-01-18 03:32

    Why don't you just use a WHERE clause?

    For example:

    SELECT city, state, country FROM  WHERE (city <> "" OR state <> "");
    

    N.B.: You'll need to replace the '<> ""' above with 'IS NOT NULL' if these are actually nulled rather than simply empty.

    提交回复
    热议问题