I have two tables, let's call them Table1 and Table2. Table1 has a column c1. and Table2 has two columns called c2 and c3.
I would like to count the occurrences of c1 from Table1 in both columns of Table2.
SELECT DISTINCT Table1.c1, count(*) FROM Table1 WHERE Table1.c1 IN(SELECT c2 OR c3 FROM Table2) GROUP BY NAME;
This apparently did not work for me, I am trying to practice different operations in SQL but I couldn't figure this one out.