CONCAT'ing NULL fields

前端 未结 11 961
小鲜肉
小鲜肉 2021-02-01 00:25

I have a table with three fields, FirstName, LastName and Email.

Here\'s some dummy data:

FirstName | LastName | Email
Adam        West       adam@west.c         


        
11条回答
  •  無奈伤痛
    2021-02-01 00:54

    Look at CONCAT_WS

    For example:

    CONCAT_WS('',NULL,"TEST STRING","TEST STRING 2")
    

    Yields

    TEST STRINGTEST STRING 2

    This is easier than constructing IFNULL around everything. You can use an empty string as the separator.

提交回复
热议问题