How easily one's brain forgets. It's been quite a while since I used JOIN in mySQL and I'm struggling to remember...
I have two tables.
The first, 'attendees', lists members who attended a particular event as follows;
date = the event date
mrn = the member record number
It might look like
The second, 'friends', lists members who are friends of an individual member as follows
mrn = the member's record number
frn = the record number of a member who is a friend of the member in mrn
it might look like
I want to look at all members who attended an event on, say, 2012-08-24, and determine if any of them were friends of member 1515.
If no attendees were friends, then the query should return 0 rows.
If at least one attendee is a friend of 1515, then the query should return more than 0 rows.
For this query, I don't actually need the data... I just need a yes/no answer on whether friends of 1515 attended, so I figured I'd get that from the number of rows returned. In the case above, there would be 1 row.
I'm not even coming close to figuring out how to construct that query so any help will be greatly appreciated.