Oracle学习笔记01:函数concat()在Oracle和Mysql下区别

 

函数concat()作用:链接字符串

区别

  1-Oracle中:CONCAT()只允许两个参数;

  2-Mysql种:CONCAT()可以连接多个参数

 

示例

Mysql

select * 
from S_MAINTAIN_CATEGORY a 
where "del_flag"=0 and "name" like concat('%','客户')
order by "type" desc

Oracle(可以通过复用concat()函数达到连接多个字符串的目的)

select * 
from S_MAINTAIN_CATEGORY a 
where "del_flag"=0 and "name" like concat(concat('%','客厅'),'%')
order by "type" desc

 

 

CONCAT(字串1, 字串2, 字串3, …): 将字串1、字串2、字串3,等字串连在一起。 
请注意,Oracle的CONCAT()只允许两个参数; 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-24
  • 2022-12-23
  • 2021-11-28
  • 2021-11-07
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案