Ashkan
Ashkan

Reputation: 169

Selecting the authors who have published in all the years

I have a table of authors containing their names, book title and year of publication. The time period if from 2000 to 2010.

I want to select authors who have published (at least once) in every single year of the examined time interval. How can I do that? Kindly advise.

Upvotes: 0

Views: 79

Answers (1)

Andomar
Andomar

Reputation: 238086

select  *
from    pubs
where   author in
        (
        select  author
        from    pubs
        where   publicationYear between 2000 and 2010
        group by
                author
        having
                count(distinct publicationYear) = 11
        )

Upvotes: 3

Related Questions