kambi
kambi

Reputation: 3423

Apostrophe while querying mysql

I have a table that contains a string column with the value "I won't go"

I want to return this row whether that user is querying "I won't go" OR "I wont go" (without apostrophe).

How should I solve this problem?

Thank you

Upvotes: 0

Views: 43

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269603

How about replacing the single quote on both sides and just doing an equality comparison:

where replace(col, '''', '') = 'I wont go'

Upvotes: 1

Related Questions