Differences in Escaping Reserved Characters
If you have a single quote or backslash in a string literal, use two backslashes instead
of one to escape it.
For example, the following statement in a Java client program is valid for finding account names like Bob's B-B-Q.
SELECT ID from ACCOUNT WHERE Name LIKE 'Bob\'s B-B-Q%'
For the AJAX Toolkit, escape the single quote literal character twice.
SELECT ID from ACCOUNT WHERE Name LIKE 'Bob\\'s B-B-Q%'