查询有什么问题?

What is wrong with the query?

我在 VB 中使用 asp.net 实现此查询,该查询的 objective 是整理 @yahoo.com 和 [= 以外的电子邮件数据14=],显示错误:

“@yahoo”和“@gmail”附近的语法不正确。

"select * from print_venue where not (email_id like %" & "@yahoo.com" & "%) AND (email_id like %" & "@gmail.com" & "%)"

上面的查询有什么问题?

您忘记了 like 语句周围的引号

"select * from print_venue 
where not (email_id like '%" & "@yahoo.com" & "%') 
AND (email_id like '%" & "@gmail.com" & "%')"

必须是

email_id like '%@yahoo.com%'

而不是

email_id like %@yahoo.com%