CONCAT_WS : 解决 连接字段中包含 NULL
CONCAT_WS( '|' , -- Separator
field_a, field_b)
1
2
2
如果字段可能为 NULL,请使用 describe 查看表结构,将所有可能为空的字段,使用 IFNULL 处理;
IFNULL(updated_at,' ')
reference
- [1] stackexchange.How to exclude NULL values inside CONCAT MySQL?open in new window