1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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,012
    Likes Received:
    203
    Trophy Points:
    0
    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,287
    Likes Received:
    364
    Trophy Points:
    83
    Moved to Oracle Forum
     

Share This Page