Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> SELECT SUM(attendants) AS total_attendants FROM (SELECT meeting_id AS meeting, COUNT(member_id) AS attendants FROM meeting_member GROUP BY (meeting_id)) AS details;
- +------------------+
- | total_attendants |
- +------------------+
- | 3 |
- +------------------+
- 1 ROW IN SET (0.00 sec)
- mysql> SELECT COUNT(id) AS total_meetings FROM meetings;
- +----------------+
- | total_meetings |
- +----------------+
- | 3 |
- +----------------+
- 1 ROW IN SET (0.00 sec)
- =====
- +------------------+----------------+
- | total_attendants | total_meetings |
- +------------------+----------------+
- | 3 | 3 |
- +------------------+----------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement