I have two queries as follows:
SELECT
Actor2Code,
COUNT(Actor2Code) AS playermentions
FROM [events]
WHERE
Year=" + Date + "
AND
(
(
(Actor1CountryCode ='" + mainPlayer1 + "')
AND
(Actor2CountryCode != '" + mainPlayer1 + "')
)
OR
(
Actor1CountryCode='" + mainPlayer2 + "'
AND
Actor2CountryCode !='" + mainPlayer2 + "'
)
)
GROUP BY Actor2Code;
AND
SELECT
Actor1Code,
COUNT(Actor1Code) AS playermentions
FROM [events]
WHERE
Year=" + Date + "
AND
(
(
(Actor2CountryCode ='" + mainPlayer1 + "')
AND
(Actor1CountryCode != '" + mainPlayer1 + "')
)
OR
(
Actor2CountryCode='" + mainPlayer2 + "'
AND
Actor1CountryCode !='" + mainPlayer2 + "'
)
)
GROUP BY Actor1Code
I merge the result in c# and I have a list of actors and another list of number of mentions.How can I make these two queries into one so that I have one actor list and no duplicated actorcodes? Some actors are in the response of both queries with different number of mentions. I want to write a query that merges the result of these two queries and gives me a list including distinct actor1codes and actor2codes and the number of mentions (for the duplicated values I need to have the sum of number of mentions)