If you want to search for a % or a _ character in a LIKE condition. You can do this using an Escape character.
Please note that you can define an escape character as a single character (length of 1) ONLY.
For example,
SELECT * FROM suppliers
WHERE supplier_name LIKE '/_%' escape '/';
This SQL statement identifies the / character as an escape character. This statement will return all suppliers whose name starts with _.
发表于 @ 2009年06月09日 22:12:00 | 评论( loading... ) | 举报| 收藏