select * from emp where ename like '[ABC]%';
Oracle 中不支持以下3中写法:
1. select * from emp where ename like '[ABC]%';
2. select * from emp where ename like '[A-D]%';
3. select * from emp where ename like '%[%]%';
要在Oracle中实现以上语句的功能,可以用如下写法:
1. select * from emp where (ename like 'A%' or ename like 'B%' or ename like 'C%');
2. select * from emp where substr(ename,1,1) in ('A','B','C');
3. select * from emp where regexp(ename, '^[ABC]');
4. select * from emp where regexp(ename ,'^[A-C]');