string(367) " FROM tabogrupopublica G INNER JOIN (SELECT MAX(DATA) as UltimaData, COUNT(NGrupo) as QuantArq, NGrupo, NTipoArq, NSec, Data FROM tabarquivos A INNER JOIN tabtipoarq T, tabcatarq C WHERE (A.NTipoArq = T.IdTipoArq) AND (T.NTipoCat = C.Id) AND ((A.VSite = 'S') OR (A.VSite IS NULL)) AND C.Id = 6 GROUP BY NGrupo ) A ON(A.NGrupo = G.IdGrupoPublica) "