Thursday, 24 de June de 2021

.: Documentos do Site

SELECT D.*, DC.*, A.*, MONTH(dat_doc) AS mes, YEAR(dat_doc) AS ano FROM documentos D, documentos_cat DC, areas A WHERE D.cod_doc_cat = DC.cod_doc_cat AND DC.cod_area = A.cod_area AND D.dat_inicio <= '2021-06-24' AND (D.dat_fim IS NULL OR D.dat_fim >= '2021-06-24') ORDER BY A.nom_area, DC.nom_doc_cat, dat_inicio