xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-09-19 23:09  xgqfrms  阅读(28)  评论(0编辑  收藏  举报