MDL-40230 core_outcome: altered group by clauses to make outcomes work with MS SQL