name | sub | week|status stu1 | math | 1 | yes stu1 | eng | 1 | stu1 | sci | 1 | no stu1 | math | 2 | yes stu1 | eng | 2 | stu1 | sci | 2 | yes
name | sub | week1 | week2 stu1 | math | yes | yes stu1 | eng | | stu1 | sci | no | yes
select name, sub, sum(case when week=1 then case when sub='math' then status when sub='eng' then status when sub='sci' then status end end) as week1, sum(case when week=2 then case when sub='math' then status when sub='eng' then status when sub='sci' then status end end) as week2 from(query for table1) group by name, sub;
"Yes"
"No"
"YesNo"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)