• mcromarty - Thursday, June 14, 2018 9:10 AM

    Hi,

    I'm not sure how to query a field that contains commas and periods with like.

    Value in db: "Acme Products, Inc."

    User is querying with "Acme Products Inc"

    Of course, using a like statement will not return any values. How can I alter the query to ignore any punctuation marks?

    Thanks!!


    See the below illustration:
    create table punch
    (
    word varchar(200)
    );

    insert into punch values('Acme Products, Inc.');
    select * from
    (select replace(replace(word,',',''),'.','') as word from punch
    )rep
    where word='Acme Products Inc'

    Saravanan