I need some help here, I'm sure you guys know how to do it: Let's start with table structure:
author(name, nationality, Gender);
article(title, year, conference);
publication(articleTitle, authorName);
I need to know the Gender of authors which have the highest number of publications. By the Way I'm using PostgreSQL, don't know if that matters.
Here's My idea:
select gender from author
join publication on(name = authorName)
having (count(articleTitle) = max(count(articleTitle)))
group by gender
Now, I know i cannot use nested aggregate functions, and that's why I'm trying to use nested selects, something like select gender where gender in (another select) But I did not managed to avoid the aggregate function issue.
Hope you can help me, Thank you