MySQL Forums
Forum List  »  Optimizer & Parser

Re: Subqueries too slow
Posted by: Andreas Schlicker
Date: February 10, 2006 03:18AM

Hi,

is there also a way to avoid subqueries if I have a something like this:

SELECT a.id, a.acc, a.name FROM a
WHERE (a.id = ANY
(SELECT b.a_id FROM b
INNER JOIN c ON b.c_id=c.id
WHERE c.acc="X")
AND NOT (a.id = ANY
(SELECT b.a_id FROM b
INNER JOIN c ON b.c_id=c.id
WHERE c.acc="Y"))
OR (a.id = ANY
(SELECT b.a_id FROM b
INNER JOIN c ON b.c_id=c.id
WHERE c.acc="Z"))

?

Andreas

Options: ReplyQuote


Subject
Views
Written By
Posted
5004
February 06, 2006 11:08AM
2522
February 06, 2006 11:54AM
2322
February 06, 2006 02:17PM
2295
February 07, 2006 07:06AM
2311
February 07, 2006 08:38AM
Re: Subqueries too slow
2334
February 10, 2006 03:18AM
2007
February 10, 2006 08:51AM
2077
February 10, 2006 09:49AM
2220
February 10, 2006 10:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.