Students Class1 Class2 Class3 student1 1 0 1 student2 0 1 0 student3 1 1 0 studnet4 0 1 1
select classname||' has '||count(num)||' students 'as no_of_students from ( select * from enroll ) unpivot ( num for classname in (class1,class2,class3) ) where num=1 group by classname;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)