In type problem in mysql
My problem is i have source 开发者_如何转开发www.yamaha.com in my table but it was not picking up. Please help me
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
thanks in advance
Try
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
Quote all separate string in IN statements :
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
syntax expects an enumeration of expressions. In your case several strings but in other case it can be numbers or dates.
From the documentation:
bit_expr [NOT] IN (subquery)
| bit_expr [NOT] IN (expr [, expr] ...)
精彩评论