Ramco Ramco

Ramco Ramco

  • 445
  • 3.4k
  • 530.3k

Column value to be computed

Jun 23 2023 8:06 AM

Hi

  In c# i have value computed like below . But i want at Sql column level. How it can be done. Sql column name is Attendance. If all records have present = false then Attendance column should have value 1. 

var result = objList.GroupBy(x => x.CalendarID)
             .Count(g => g.All(x => x.Present == false));

Thanks


Answers (2)