select DocType, Count(*), Sum(Length(bincontent)), Max(Length(bincontent)) from t_document group by doctype