Declare @mobile varchar(20)
If @mobile like '971%'
Begin
Set @mobile='+'+@mobile
End
如果我将手机号码传递为 9715628
...
我应该得到的结果为+9715628...
最佳答案
使用CONCAT
。
Set @mobile=CONCAT('+', @mobile);
MySQL中的+
表示算术加法运算。
您不能使用 +
在 MySQL 中连接字符串。
关于mysql - 如何在Sql数据库中的varchar中添加+符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39061188/