Good, thanks Colin.
Will the [Group] names be exactly "G1", "G2", ..., or will they only contain those strings? I am wondering about your use of
where [Group] like "%G1%"..."%G6%"
And can you put what you need into English? E.g. "For each Site_id, the number of different(?) groups present, and for each group, the total value". Is that it?