Skip to main content
1 of 2
Babel
  • 74.9k
  • 15
  • 87
  • 227

You can always mask every character, including single or double quotes, by using their ascii-code:

  • char(39) returns a single quote: '
  • char(34) returns a double quote: "

To find the ascii code, simply look for it with ascii(): ascii('a') returns 97. To find the ascii code for single quotes, enter ascii('''') - this returns 39.

Thus you can also use:

CASE
WHEN "NAME" = 'WILSON' || char(39) || 'S' THEN '0,75,224'
END

char even works for Unicode codes:

Babel
  • 74.9k
  • 15
  • 87
  • 227