Created
March 15, 2024 13:48
-
-
Save JRGGRoberto/2c51414743968b1b69a984358e3d267f to your computer and use it in GitHub Desktop.
View que junta todos os projetos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW `projetostb` AS | |
select | |
n.id AS id, | |
n.coordenador AS coordenador, | |
n.titulo AS titulo, | |
n.campus AS campus, | |
n.ano AS ano, | |
n.arq_projeto AS arq_projeto, | |
n.arq_relatorio AS arq_relatorio, | |
n.versao AS versao | |
from | |
( | |
select | |
p.id AS id, | |
p.nome_prof AS coordenador, | |
p.titulo AS titulo, | |
p.campus AS campus,date_format(p.vigen_fim,'%Y') AS ano, | |
concat('../projetos/visualizar.php?id=',p.id,'&v= ',p.ver,'&w=nw') AS arq_projeto, | |
NULL AS arq_relatorio, | |
'n' AS versao | |
from | |
unespar_sistema.avaliacoes a | |
join unespar_sistema.proj_inf_lv p on a.id_proj = p.id and a.ver = p.ver | |
where | |
a.fase_seq = 6 and a.resultado = 'a' | |
) n | |
union all | |
select | |
p.id AS id, | |
p.coordenador AS coordenador, | |
p.titulo AS titulo, | |
p.campus AS campus, | |
p.ano AS ano, | |
p.arq_projeto AS arq_projeto, | |
p.arq_relatorio AS arq_relatorio,'o' AS versao | |
from | |
unespar_sisproec.projetostb p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment