Total attachments in "pdfbox_1_8_8" by detected content type

DETECTED_CONTENT_TYPE_A Number of attachments total NUM_FILES Average number of attachments per file
application/pdf
7312
231211
0.03




SELECT comparisons.DETECTED_CONTENT_TYPE_A, sum(ifnull(NUM_ATTACHMENTS_A, 0)) as "Number of attachments total", detected_types_A.NUM_FILES as TOTAL_FILES, DEC_PATTERN((1.0*sum(ifnull(NUM_ATTACHMENTS_A, 0))/detected_types_A.NUM_FILES), '###,###.##') as "Average number of attachments per file" from comparisons left outer join detected_types_A on comparisons.DETECTED_CONTENT_TYPE_A=detected_types_A.DETECTED_CONTENT_TYPE_A group by comparisons.DETECTED_CONTENT_TYPE_A having "Number of attachments total" > 0 order by "Number of attachments total" desc;