I'm trying to get some practice making queries with SQL.
I'm working with a playground that uses SQLite.
There are two tables:
INNER JOIN books_south
ON books_north.title = books_south.title;
UNION ALL to get the
count of each
Select Title,Count(1) as [Count] From ( SELECT title FROM books_north bn union all select title from books_south bs ) A Group by Title
Another approach using
FULL OUTER JOIN (If your
SELECT COALESCE(bn.Title, bs.title) as title, ( bn.[count] + bs.[count] ) AS [Count] FROM (SELECT title, Count(1) AS [count] FROM books_north GROUP BY title) bn FULL OUTER JOIN (SELECT title, Count(1) AS [count] FROM books_south GROUP BY title) bs ON bn.Title = bs.Title
Regarding your error message, Title column is present in the both the table so when you
Title column you need to tell the compiler from which table you want to select
Title column. It can be done by giving a alias name to the tables in