"\t\tcase when te.device_name is null OR te.device_name='' then '-' else te.device_name end as device_name,\n"+
"\t\tcase when te.location_name is null OR te.location_name='' then '-' else te.location_name end as location_name,\n"+
" road_code as road,\n"+
"\t\tSUM(td.velocity*td.sample_num)/(CASE WHen sum(td.sample_num)=0 then 1 ELSE sum(td.sample_num) end) as velocity,AVG(td.occupy) as occupy,AVG(td.distance) as distance ,AVG(td.queue_length) as queue_length,AVG(td.sample_dura) as sample_dura ,\n"+
"\t\tcase when te.device_name is null OR te.device_name='' then '-' else te.device_name end as device_name,\n"+
"\t\tcase when te.location_name is null OR te.location_name='' then '-' else te.location_name end as location_name,\n"+
" case when td.direction_code is null OR td.direction_code='' then '-' else td.direction_code end as direction,\n"+
"\t\tSUM(td.velocity*td.sample_num)/(CASE WHen sum(td.sample_num)=0 then 1 ELSE sum(td.sample_num) end) as velocity,AVG(td.occupy) as occupy,AVG(td.distance) as distance ,AVG(td.queue_length) as queue_length,AVG(td.sample_dura) as sample_dura ,\n"+