select distinct studentid,
(select attendance from abc where day='Day1' and abc.studentid=t1.studentid) day1,
(select attendance from abc where day='Day2' and abc.studentid=t1.studentid) day2,
(select attendance from abc where day='Day3' and abc.studentid=t1.studentid) day3
from abc t1