create table ApplicationTracker_dup1
select transactionid,
count(case when attribute = 'Secci_Page_Arrival_Time' and value is not null then transactionid end)as secci_visits,
count(case when attribute = 'esign_arrival_time' and value is not null then transactionid end)as esig_visits
from ApplicationTracker_dup
where create_dtm < '2013-08-13'
group by 1;
create table ApplicationTracker_dup1
select tra