Welcome to the Treehouse Community
Looking to learn something new?
Bruce McMinn10,029 Points
Subqueries Review & Practice # 1 Clunky Answer
So question 1 asks for a list of all titles and a count of duplicate books. That sounds like a column of words and another column with a single numeric entry. Can I combine these two making a derived table of either?
-- a list of all books, no duplicate titles SELECT bn.title FROM books_north AS bn EXCEPT SELECT bs.title FROM books_south AS bs UNION SELECT bs.title FROM books_south AS bs;
-- a complicated way to get the number 12 SELECT COUNT(*) AS BooksWithMultipleCopies FROM (SELECT COUNT(*) as book_num FROM (SELECT title FROM books_north UNION ALL SELECT title FROM books_south) GROUP BY title HAVING book_num>1);
I'm guessing that there isn't a good join criteria??