Това е основно запитване. Бих го направил с условно агрегиране:
select user, access_date,
max(case when FORMFACTOR = 'Mobile' then 1 else 0 end) as KEY_MOBILE,
max(case when FORMFACTOR = 'Desktop' then 1 else 0 end) as KEY_DESKTOP,
(case when max(case when FORMFACTOR = 'Mobile' then 1 else 0 end) > 0 and
max(case when FORMFACTOR = 'Desktop' then 1 else 0 end) > 0
then 1 else 0
end) as KEY_MOBILE_DESKTOP
from table t
group by user, access_date;