List:General Discussion« Previous MessageNext Message »
From:Paul Nowosielski Date:January 11 2006 7:41pm
Subject:Problem using IN statement MySQL 5
View as plain text  
Hello,

I'm trying to run q query with an IN statement in MySQL 5. Like so:

SELECT * from encore enc, article art
WHERE  enc.encore_id= '10' AND `article_id` IN (`articles`)

Its should return all the articles in the encore.articles column but
instead only returns the first article.

In encore,articles is the data 43,44,45,46.
These are article IDs. If I manually place 43,44,45,46 into the query
like so:

SELECT * from encore enc, article art
WHERE  enc.encore_id= '10' AND `article_id` IN (43,44,45,46)

All 4 articles are returned. Any ideas why this is not working?

TIA!

-- 
Paul Nowosielski
Webmaster 
2401 Broadway St
Boulder, Co 80304
Tel: 303.440.0666 ext:219 
Cell: 303.827.4257
www.celebrityaccess.com
www.protouronline.com
www.boxofficenetwork.com

Thread
Problem using IN statement MySQL 5Paul Nowosielski11 Jan
  • Re: Problem using IN statement MySQL 5David Griffiths11 Jan
  • Re: Problem using IN statement MySQL 5Peter Brawley11 Jan
  • Re: Problem using IN statement MySQL 5SGreen11 Jan