1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

select * from employees where emp_name like '%'%';

Discussion in 'SQL PL/SQL' started by Vicky, Jul 2, 2014.

  1. Vicky

    Vicky Forum Advisor

    Messages:
    261
    Likes Received:
    11
    Trophy Points:
    260
    Location:
    Chennai
    select * from employees where emp_name like '%'%';

    the query above is not workng.,.

    how to find the records having the character " ' " in it.,.?!!
     
  2. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    What exactly are you trying to do?

    If you're trying to find entries w/ a ' in it then the center most ' needs to be ''' or ''''.

    HTH
     
    Vicky likes this.
  3. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
  4. rajenb

    rajenb Forum Expert

    Messages:
    361
    Likes Received:
    114
    Trophy Points:
    655
    Location:
    Mauritius
    Hi Vicky,

    Try : select * from employees where emp_name like '%''%';

    (two ' characters not " character).
     
    Vicky likes this.
  5. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    You can also search by the ASCII value for a single quote, 39:

    Code (Text):
    SELECT *
    FROM   employees
    WHERE  emp_name LIKE '%' || CHR(39) || '%';
     
    Vicky likes this.