2 messages in com.mysql.lists.mysqlRe: Error in Complex SELECT
FromSent OnAttachments
Adam Ernst28 Dec 2004 10:13 
Christopher Fulton28 Dec 2004 10:31 
Subject:Re: Error in Complex SELECT
From:Christopher Fulton (chri@gmail.com)
Date:12/28/2004 10:31:12 AM
List:com.mysql.lists.mysql

I believe your problem is that versions of MySQL prior to 4.1 (i think) do not allow subqueries. You may try rewriting your query as a join.

On Tue, 28 Dec 2004 12:14:06 -0600, Adam Ernst <adam@athenet.net> wrote:

I'm trying to do the following SELECT statement:

SELECT * FROM matches WHERE question_id = ANY (SELECT server_id FROM questions WHERE results_id = 'MyID')

I've tried rephrasing it as:

SELECT * FROM matches WHERE question_id IN (SELECT server_id FROM questions WHERE questions.results_id = 'MyID')

And even:

SELECT * FROM matches WHERE question_id IN (SELECT q.server_id FROM questions as q WHERE q.results_id = 'MyID')

But no go--in all cases, I get an syntax error near the first parentheses.

Any suggestions? This is on MySQL 4.0.22-standard.

Thanks,