MySQL Forums
Forum List  »  MySQL Query Browser

Join, nested select, hmmmm
Posted by: willie wonka
Date: July 10, 2012 05:27AM

Hi all,

I have two identical tables each with a single column (id mediumint)
Table "Bill" has 12 rows: values (A,B,B,C,C,C,C,C,D,D,E,E)
Table "Mike" has 5 rows : value (A,C,C,D,F)

I want to query these tables and produce a result like:

---Bill----Mike
A---1-------1
B---2-------0
C---5-------2
D---2-------1
E---2-------0
F---0-------1

This tells me that there are 2 Bs in Bill, and 5 Cs in Bill, and 0 Es in Mike, etc., I have been trying to do a join, but I think I need something else?

Use count, group by...hmmm

Thanks in advance for your help,
Willie

Options: ReplyQuote


Subject
Written By
Posted
Join, nested select, hmmmm
July 10, 2012 05:27AM


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.