Basically, I am trying to sum up the value of a calculated field when a certain value (in my case COMMUNICATIONS_ID) are equal. These scores are associated with the same COMMUNICATIONS_ID and I want to sum up these values.
I am new to SQL and this is my misguided first attempt:
SELECT *
FROM consumer_action_log as cal1
JOIN consumer_action_log as cal2
ON cal1.COMMUNICATIONS_ID=cal2.COMMUNICATIONS_ID
AND cal1.COMM_TYPE_ID=4
I don’t see a need to JOIN the table to itself here.