0

column title should not have single quotation punctuation(')

sqlite interpreter could not interpret this below query:

sqlite> .schema movie
CREATE TABLE movie (
  id INTEGER PRIMARY KEY, title TEXT, year INTEGER, nth TEXT, for_video BOOLEAN
  );
sqlite> 
sqlite> 
sqlite> 
sqlite> SELECT title
   ...> FROM movie
   ...> WHERE title NOT LIKE '%\'%'
   ...> ORDER BY title ASC LIMIT 1;
   ...> 

How to check for single quotation punctuation? for both mysql and sqlite

overexchange
  • 13,706
  • 19
  • 106
  • 276

1 Answers1

1

The SQL standard uses two single quotes to escape a single quote in a string:

WHERE title NOT LIKE '%''%'
Gordon Linoff
  • 1,198,228
  • 53
  • 572
  • 709