mysql> select concat(name,':',sex) from pet1; +----------------------+ | concat(name,':',sex) | +----------------------+ | 1:c | | NULL | | a:n | | abc:n | +----------------------+ 4 rows in set 如果其中有一字段为null,则显示null
时间: 2024-10-03 23:10:09
mysql> select concat(name,':',sex) from pet1; +----------------------+ | concat(name,':',sex) | +----------------------+ | 1:c | | NULL | | a:n | | abc:n | +----------------------+ 4 rows in set 如果其中有一字段为null,则显示null