MySql :Concat(str1,str2,str3,.....)
Oracle:Concat(),||
Sql:+ (like '%'+#{fileTitle,jdbcType=NVARCHAR}+'%')
Oracle的CONCAT()只允许两个参数;
换言之,一次只能将两个字串串连起来。不过,在Oracle中,我们可以用'||'来一次串连多个字串。
来看几个例子。假设我们有以下的表格:
Geography 表格
region_name | store_name |
East | Boston |
East | New York |
West | Los Angeles |
West | San Diego |
例子1:
MySQL/Oracle:
SELECT CONCAT(region_name,store_name) FROM Geography
WHERE store_name = 'Boston';
结果:
'EastBoston'
例子2:
Oracle:
SELECT region_name || ' ' || store_name FROM Geography
WHERE store_name = 'Boston';
结果:
'East Boston'
例子3:
SQL Server:
SELECT region_name + ' ' + store_name FROM Geography
WHERE store_name = 'Boston';
结果:
'East Boston'
转自:http://blog.sina.com.cn/s/blog_4b93170a0100biyp.html