Sql Sum Case Distinct Example