string(1342) "SELECT DISTINCT C.CONCURSO,
						C.DESCRICAO AS DESC_CONCURSO,
						FC.FASE,
						C.PROEM,
						C.ENEM,
						C.TREINEIRO,
						C.IDIOMA,
						NVL(PB.VALOR, C.VL_MAXIMO) AS VALOR,
						C.DT_INSCRICAO_INI,
						C.DT_INSCRICAO_FIM,
						C.DT_EXPIRA_CONC,
						(SELECT COUNT(1)
						   FROM PS.FASES_CONCURSOS X
						  WHERE CONCURSO = C.CONCURSO
							AND FASE = fc.fase
							AND DT_RESULTADO <= SYSDATE) LIB_RESULTADO,
						(SELECT COUNT(1)
						   FROM PS.FASES_CONCURSOS X
						  WHERE CONCURSO = C.CONCURSO
							AND FASE = fc.fase
							AND DT_GABARITO <= SYSDATE) LIB_GABARITO,
						(SELECT COUNT(1)
						   FROM PS.FASES_CONCURSOS X
						  WHERE CONCURSO = C.CONCURSO
							AND FASE = fc.fase
							AND dt_convocacao -1 <= SYSDATE) LIB_CONVOCACAO,
						CASE
						  WHEN SYSDATE BETWEEN C.DT_INSCRICAO_INI AND
							   C.DT_INSCRICAO_FIM THEN
						   1
						  ELSE
						   0
						END AS LIB_INSCRICAO
		
		  FROM PS.CONCURSOS C
		  JOIN PS.FASES_CONCURSOS FC
			ON FC.CONCURSO = C.CONCURSO
		  LEFT JOIN PS.PARAMETROS_BOLETOS PB
			ON PB.CONCURSO = C.CONCURSO
		 WHERE C.TIPO_INGRESSO = 32
		   AND C.STATUS = 1
		   AND UPPER (c.descricao) NOT LIKE '%MEDICINA%'
		   AND SYSDATE BETWEEN C.DT_INSCRICAO_INI AND C.DT_EXPIRA_CONC
		 ORDER BY C.CONCURSO DESC,fc.fase"