string(442) " FROM tabataregistro a INNER JOIN TabLicitacao l on (a.NLicitacao = l.IdLicita) inner join TabModLicita m on (l.NModalidade = m.IdModLicita) left join (select NLicita, group_concat(t2.Descricao separator ', ') as GroupSec from tablicitaorgao t inner join tabsecretarias t2 on (t.NSec = t2.IdSecretarias) group by NLicita ) g on (g.NLicita = l.IdLicita) WHERE a.IdAtaRegistro > 0 and a.DtDelete is null "