There are 2 tables SL and DL. DL:id, device_name, username SL: id, time(hh:mm:ss) My required output should be I tried query select DE.device_name, AVG(SL.time),MAX(SL.time) FROM DE INNER JOIN SLON DE.id= SL.idgroup by DE.device_name and few other queries, I get average and maximum duration in column header and rest all values zero. I should get average values and max values for every device _name. Help me get it using crosstab element in jasper soft studio.