Postgresql – Join and group by based on a value of a column to filter
Let's say I have two tables with these data: author id | name --------- 1 | John 2 | Jack 3 | James 4 | Bob 5 | Gorge book id | author_id | title | state ------------------------------------- 1 |…