0
点赞
收藏
分享

微信扫一扫

MySQL中 find_in_set 函数如何替换成Oracle写法

林塬 2022-03-12 阅读 176
下面sql语句是MySQL写法
select count(*) from sys_dept where status = 0 and del_flag = '0' and 
find_in_set(#{deptId}, ancestors)
在Oracle环境下运行则会出现这样的错误

ORA-00920:无效的关系运算符

在Oracle中的正确写法为
select count(*) from sys_dept where status = 0 and del_flag = '0'
 and instr(#{deptId}, ancestors)>0
举报

相关推荐

0 条评论