string(317) " FROM tabarquivos A LEFT JOIN tabcompetencia cp on (A.NComp = cp.IdComp), tabtipoarq T, tabcatarq C WHERE (A.NTipoArq = T.IdTipoArq) AND (T.NTipoCat = C.Id) AND T.NTipoCat = 1 AND NTipoArq = :cat "