Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
能否解释一下Oracle中concat()函数和运算符的区别?||
concat()
||
哪一个在性能方面更好?
没有功能上的区别。
||是 ANSI 标准字符串连接运算符(但不幸的是,并非每个数据库都<cough>SQL Server</cough>选择支持该标准)。许多数据库都支持一个CONCAT函数,因此将代码移植CONCAT到不同的数据库可能会更容易。
<cough>SQL Server</cough>
CONCAT
'concat' 函数只能对 2 个变量或列进行操作,而 'concat' 操作可以对任意数量的变量或列进行。