RAZ-2336: Added missing column to group by which would throw an error with MS SQL