SQL CONCAT All In One
SQL CONCAT All In One
select CONCAT(firstname, ' ', lastname) as fullname, (salary * 12 + experience * 500) as total from staff ORDER BY total;
/*
-- select firstname, lastname as fullname from staff
-- select (firstname,lastname) as fullname from staff ORDER BY total;
-- total experience * 500
*/
CONCAT
-- CONCAT(s1, s2, ..., sn) 字符串 s1, s2, ...,, sn 等多个字符串合并为一个字符串
-- 合并多个字符串
SELECT CONCAT("MySQL", " ", "is Awesome!") AS ConcatenatedString;
https://www.w3schools.com/sql/func_mysql_concat.asp
https://www.runoob.com/mysql/mysql-functions.html
https://www.runoob.com/sql/sql-alias.html
refs
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/16709490.html
未经授权禁止转载,违者必究!