留言与评论(共有 0 条评论) |
发布时间:2020-04-15 16:55:26
在MYSQL中字符串连接使用的是concat内置函数。可以写为:select * from myDB where name =concat('a','bc')
在SQL Server中字符串连接用+号。可以写为:select * from myDB where name ='a'+'bc'
在Oracle中字符串连接用的是||号。
使用 + 进行字符串连接时会为每次运算分配内存,例如 'a' + 'b' + 'c' 会先计算 'a' + 'b',将结果暂存,然后在加上 'c',每次运算都会分配一个内存存储中间结果。而使用 list 的 join 或者 %s 就不会产生那么多中间结果。
在MYSQL中字符串连接使用的是concat内置函数。可以写为:select * from myDB where name =concat('a','bc')
在SQL Server中字符串连接用+号。可以写为:select * from myDB where name ='a'+'bc'
在Oracle中字符串连接用的是||号。
留言与评论(共有 0 条评论) |
全站搜索