Question:Basically, I have a table that tells about type of communication to accounts(either by letter or email) like :
and so on.. A query needs to be written that counts :
- the number of accounts that received letter only,
- the number of accounts that received mails only,
- the number of accounts that received both letters and mails
So the output of above should be :
|Type_of_comms||Count of Accounts|
|both letters and mails||1|
Thanks in advance!
Answer:I’m not familiar with Athena, but as long as it supports CTEs / subqueries, this should work:
If you have better answer, please add a comment about this, thank you!