如何在 MySQL 中的搜索中使用 @ 进行 LIKE 搜索?

How do I do a LIKE search with an @ in the search in MySQL?

I don't see @ as a special character in the MySQL list 但是我的 SELECTLIKE@ 给了我一个空的结果。我想做一些像

SELECT email from myTable WHERE email LIKE '%@domain.com'

您可以尝试使用 ESCAPE 子句(随意猜测):

SELECT email 
from myTable 
WHERE email LIKE '%!@domain.com' ESCAPE '!';

另一种选择是trim您的电子邮件(可能是一些白色字符):

SELECT email 
from myTable 
WHERE TRIM(email) LIKE '%@domain.com';