user12349310
user12349310

Reputation:

How do I join my result to retrieve another table's corresponding records?

(SELECT BOOKAUTHOR from (select DISTINCT bookauthor, genre from BOOK) group by bookauthor HAVING COUNT(*) > 1);

So confused about joins

please let me know if there is anyway to improve my question, i have tried to search and search and am still so confused to make this happen

Upvotes: 0

Views: 39

Answers (1)

You'd do something like

SELECT a.AUTHORFIRSTNAME,
       a.AUTHORLASTNAME
  FROM (SELECT BOOKAUTHOR, COUNT(*)
          FROM BOOK
          GROUP BY BOOKAUTHOR
          HAVING COUNT(*) > 1) b
  INNER JOIN AUTHOR a
    ON a.AUTHORID = b.BOOKAUTHOR

dbfiddle here

Upvotes: 1

Related Questions