连接 nvarchar 时 + 和 ++ 有什么区别?
What is the difference between + and ++ when concatenating nvarchar?
我刚看到 sql 代码,它用“++”连接了 2 个字符串。我总是使用单加号,比如 '+'
使用'++'有什么意义
PRINT 'TEST ' ++ 'TEST'
PRINT 'TEST ' ++++++++++++ 'TEST'
或
PRINT 5+++++++++++++++++++++2
仍然有效,因为,
"Although a unary plus can appear before any numeric expression, it performs no operation on the value returned from the expression. "
查看以下文档:
https://msdn.microsoft.com/en-us/library/ms174362.aspx
我刚看到 sql 代码,它用“++”连接了 2 个字符串。我总是使用单加号,比如 '+'
使用'++'有什么意义
PRINT 'TEST ' ++ 'TEST'
PRINT 'TEST ' ++++++++++++ 'TEST'
或
PRINT 5+++++++++++++++++++++2
仍然有效,因为, "Although a unary plus can appear before any numeric expression, it performs no operation on the value returned from the expression. "
查看以下文档: https://msdn.microsoft.com/en-us/library/ms174362.aspx