• ADADADADAD

    mysql 字符串拼接+设置null值[ mysql数据库 ]

    mysql数据库 时间:2024-12-25 09:57:22

    作者:文/会员上传

    简介:

    #字符串拼接 concat(s1,s2); 将表中last_name和first_name中的字符串拼接select concat(last_name,first_name) as姓名 from employees;#只会修改last_name不会修改first_na

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    #字符串拼接 concat(s1,s2); 将表中last_name和first_name中的字符串拼接

    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值.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: mysql符串null值