How to check in where clause ?

  • Gurus,

    I have a table with a column of varchar type.

    Values are some thing like

    ASO '02 CHOICE 06

    ASO '02 CHOICE 07

    ASO '02 CHOICE 08

    How do I compare the value in where clause

    Select *

    from t

    where c1 = 'ASO '02 CHOICE 06'

    getting error

    Thanks.

    Cnu

  • Try this:

    SET QUOTED_IDENTIFIER OFF

    GO

    Select *

    from t

    where c1 = "ASO '02 CHOICE 06"

    HTH,

    Supriya

  • Thanks for help.

    Its working supriya.

    Cnu

  • Also,

    if you want to avoid

    SET QUOTED_IDENTIFIER OFF

    you can also use this

    Select *

    from t

    where c1 = 'ASO ''02 CHOICE 06'

    here there are two single quotes before 02 which sql reads as a single quote when used in a string

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply