MySQL Forums
Forum List  »  Performance

Re: (multiple join + subqueries) performence
Posted by: Peter Brawley
Date: November 18, 2008 07:09PM

Sorry, on the data you show...
+-----+-----+
| eid | aid |
+-----+-----+
| X   | a   |
| X   | b   |
| Y   | a   |
| Z   | b   |
| T   | a   |
| U   | a   |
+-----+-----+
I do not understand how your spec, "list ... eid that share the same aid as (eid='X' and eid='Y') or same as (eid='X') or same as (eid='Y'), as well as the number of aid that they share", could generate row 3 in the desired result you show:
| eid1 | eid2 | eid3 | count(aid)
| X    | Y    | T    | 1
| X    | Y    | U    | 1
| X    |      | Z    | 1
BTW, your data & result displays are more readable if you surround them with [ code ] [ /code ] tags (without the spaces).

PB
http://www.artfulsoftware.com

Options: ReplyQuote


Subject
Views
Written By
Posted
3273
November 18, 2008 05:48PM
Re: (multiple join + subqueries) performence
1811
November 18, 2008 07:09PM


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.