On Escape characters..ORACLE

Discussion in 'Oracle' started by srijith.ramachandran, Mar 16, 2009.

  1. srijith.ramachandran

    srijith.ramachandran New Member

    Joined:
    Mar 16, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Because you need to use LIKE, i.e. ename LIKE '%AME%'.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Moved to Oracle Forum
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice