我如何将文本附加到另一个单元格中的文本上?

问题描述 投票:0回答:1

嘿,在MySql中工作,并创建了一个名称库。

现在,我有一列名为“团队名称”的列,即“ Ohno Romo”。我希望标题为“ opp code”的列看起来像这样:“ team(Ohno Romo)”

[如果有人可以帮助我,请在团队名称之前和之后添加“团队”和括号,这将非常有帮助。谢谢!

mysql concatenation concat
1个回答
0
投票

对于这种类型的字符串处理,请使用CONCAT()

set @str_1 = 'opp code', @str_2 = 'Ohno Romo';

select concat(@str_1, '(', @str_2, ')');

https://dev.mysql.com/doc/refman/8.0/en/string-functions.html

© www.soinside.com 2019 - 2024. All rights reserved.