Skip to main content
added 2 characters in body
Source Link
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')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:

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:

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:

Source Link
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: