Sqlserver
 sql >> Datenbank >  >> RDS >> Sqlserver

Zeilen mit Nullen und Duplikaten in einzelne Zeilen komprimieren

Select
   ID,
   AssnDate,
   AssnTxt,
   Max(IsNull(Sally,0)) AS Sally,
   Max(IsNull(Ted, 0)) As Ted,
   Max(IsNull(Bob, 0)) As Bob
From vwGrades
Group By
  ID,
  AssnDate,
  AssnTxt