时间:2021-07-01 10:21:17 帮助过:16人阅读
select concat(last_name,first_name) as 姓名 from employees;
#只会修改last_name不会修改first_name
SELECT first_name,last_name AS f FROM employees;
#将两个列用逗号隔开并命名为out_put
SELECT CONCAT(`last_name`,‘,‘,`phone_number`) AS out_put FROM employees;
#ifnull 判断是否为空,如果为空则显示为0而不是null,并将列名显示为结果
SELECT IFNULL(commission_pct,0) AS 结果 FROM employees;
mysql 字符串拼接+设置null值
标签:姓名 mys employees put rom mis ber sql hone