string(410) " FROM tabsecretarias s LEFT JOIN ( SELECT NSec , Nome, DescCargo FROM tabsecretariagestor s INNER JOIN tabvereador g on (s.NGestor = g.IdVereador) INNER JOIN tabcargo c on (s.NCargo = c.IdCargo) WHERE s.Tipo = 'S' AND ((DataFim > CURDATE()) OR (DataFim IS NULL)) ) ge ON (s.IdSecretarias = ge.NSec) WHERE (MostrarSite = 'S' OR MostrarSite IS NULL) "