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
  • 15,768
  • 30
  • 152
  • 347

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,242,037
  • 58
  • 646
  • 786