Blog | Tutorial

A simple mysql JOIN statement

I thought I`d note here a simple mysql JOIN to remind me how it works. if it helps you too then that is good.
I wanted to run a query on my people in the database (table: who) and against the list of members in the club (table:mem)

SELECT mem.person, who.email, mem.club
FROM mem
INNER JOIN who ON who.ID = mem.person
WHERE mem.club = `2142`


This returns the person ID, their email and their club identifier. In this case I`m looking to find the email of all members in the club `2142`