How to display the names only with character '_' in oracle?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pavani reddy

    #1

    How to display the names only with character '_' in oracle?

    Is this right?

    select * from emp where like"%_%;
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Try this:

    [code=oracle]
    SQL> ed
    Wrote file afiedt.buf

    1 with t as (select 'my_name' col1 from dual
    2 union select 'first_last' from dual
    3 union select 'firstlast' from dual)
    4* select col1 from t where INSTR(col1,'_', 1,1) > 0
    SQL> /

    COL1
    ----------
    first_last
    my_name

    SQL>
    [/code]

    Comment

    Working...