我的问题是我的表中有www.yamaha.com的源代码,但它没有找到。请帮我
SELECT * FROM linkbound_report_source l
WHERE source in ('www.yamaha.com ,www.desmogblog.com ,www.cleantechnica.com ,www.thehill.com ,www.grist.org')
ORDER BY l.report_source_id desc
提前感谢
尝试
SELECT * FROM linkbound_report_source l
WHERE source in ('www.yamaha.com','www.desmogblog.com','www.cleantechnica.com','www.thehill.com','www.grist.org')
ORDER BY l.report_source_id desc
在in语句中引用所有单独的字符串:
SELECT * FROM linkbound_report_source l
WHERE source in ('www.yamaha.com' , 'www.desmogblog.com' ,'www.cleantechnica.com' ,'www.thehill.com' ,'www.grist.org')
ORDER BY l.report_source_id desc
SQL IN
语法要求枚举表达式。在您的情况下是几个字符串,但在其他情况下可以是数字或日期。
来自文件:
bit_expr [NOT] IN (subquery)
| bit_expr [NOT] IN (expr [, expr] ...)