MySQL CONCAT returns NULL if any field contain NULL

后端 未结 6 913
青春惊慌失措
青春惊慌失措 2020-11-28 04:38

I have following data in my table \"devices\"

affiliate_name  affiliate_location  model     ip             os_type    os_version 

cs1             inter             


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 05:10

    To have the same flexibility in CONCAT_WS as in CONCAT (if you don't want the same separator between every member for instance) use the following:

    SELECT CONCAT_WS("",affiliate_name,':',model,'-',ip,... etc)
    

提交回复
热议问题