On Escape characters..ORACLE

srijith.ramachandran's Avatar, Join Date: Mar 2009
Newbie Member
Hi All,

i have a query...

why does the below sql query ie (a) returns no row, while the statement (b) displays rows

(a) select * from sri where ename='%AME%';

----->no rows selected

(b) select * from sri where ename='JAMES';

--->
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ---------- --------- ---------- ---------- ----------
7900 JAMES CLERK 7698 03-DEC-81 950 30
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Because you need to use LIKE, i.e. ename LIKE '%AME%'.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Moved to Oracle Forum