Sql Group By Substring C