Perfect! I just had to add a column alias and an order by clause.
The nested select method wasn't one I was familiar with.
User Profile
Collapse
-
-
The full table structures are below. Any query I wrote isn't worth posting as I'm not really sure how to get started. I would think I'd need to inner join the tables based on the member id, but I couldn't get it to work. I'm pretty new to mySQL and databases in general.
...Code:CREATE TABLE `members` ( `member_id` int(10) NOT NULL auto_increment, `first_name` varchar(50) NOT NULL, `last_name` varchar(50)
Leave a comment:
-
Question About Inner Joins and COUNT()
I'm trying to write a query that selects the top five members of a forum based on how many total points they have. A member's total points are calculated as follows: (3 * # answers posted) + (10 * # questions posted) + (15 * # members recruited). The relevant parts of the tables are listed below:
...Code:table members ( member_id int(10), ... recruiter_id int(10) /* id of member who recruited
No activity results to display
Show More
Leave a comment: