Home Forums SQL Server 2012 SQL Server 2012 - T-SQL cross tab query RE: cross tab query
Stefan_G
SSCertifiable
Points: 6609
More actions
August 28, 2013 at 3:49 am
#1645465
Something like this perhaps:
select
cpr,
attendance_date,
trans_in = max(case when trans_type='I' then 'In' end),
trans_out = max(case when trans_type='O' then 'Out' end),
from Table
group by cpr, attendance_date