List:General Discussion« Previous MessageNext Message »
From:David Griffiths Date:January 11 2006 7:45pm
Subject:Re: Problem using IN statement MySQL 5
View as plain text  
Your select has two tables, but you don't join them.

Can you provide the table info, and a subset of the data that should be 
pulled back by this query?

David

Paul Nowosielski wrote:

>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!
>
>  
>
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