1) You're grouping by 'program id' and not mentioning any other fields as group or sum. You need to remove all grouping or ensure all fields are included in some way.
2) The 'Sent' field has a different name in query B1.
3) 'Clicks' field has a different name in query B1.
4) 'Sent' field has a different name in query B1.
I think that fixes it.