Ramco Ramco

Ramco Ramco

  • 469
  • 2.8k
  • 390k

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)