-
-
Save tyoshikawa1106/2c182c1efc2bffa2e3d5 to your computer and use it in GitHub Desktop.
SOQLのLIKEと%
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String key = '株式会社 セールスフォース%ドットコム'; | |
String query = 'SELECT Name FROM Account WHERE Name LIKE ' + '\'' + String.escapeSingleQuotes(key + '%') + '\''; | |
System.debug(query); | |
List<Account> accounts = database.query(query); | |
for (Account a : accounts) { | |
System.debug(a.Name); | |
} | |
System.debug(accounts.size()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment