Skip to content
Snippets Groups Projects
Commit 3fb81f8a authored by lgtg20's avatar lgtg20
Browse files

fix: sort subqueries by year

parent d9690175
Branches
No related tags found
4 merge requests!449Homologa,!444dev -> hom,!440New indicators,!432Issue 953
...@@ -585,7 +585,8 @@ basicEducationConclusion.get('/', rqf.parse(), rqf.build(), (req, res, next) => ...@@ -585,7 +585,8 @@ basicEducationConclusion.get('/', rqf.parse(), rqf.build(), (req, res, next) =>
.field("SUM(peso_domicilio_pessoas_com_cal)", "total") .field("SUM(peso_domicilio_pessoas_com_cal)", "total")
.where("idade_morador_31_03 >= 19") .where("idade_morador_31_03 >= 19")
.where("ano_ref >= 2019") .where("ano_ref >= 2019")
.group("ano_ref"); .group("ano_ref")
.order("ano_ref");
// Subquery para total_pop_ed_bas_maior_19 com filtros dinâmicos // Subquery para total_pop_ed_bas_maior_19 com filtros dinâmicos
let totalPopEdBasMaior19 = req.sql.clone(); let totalPopEdBasMaior19 = req.sql.clone();
...@@ -595,7 +596,8 @@ basicEducationConclusion.get('/', rqf.parse(), rqf.build(), (req, res, next) => ...@@ -595,7 +596,8 @@ basicEducationConclusion.get('/', rqf.parse(), rqf.build(), (req, res, next) =>
.where("idade_morador_31_03 >= 19") .where("idade_morador_31_03 >= 19")
.where("nivel_de_instruc_mais_elevad_para_o_fundam_com_duracao_9_anos IN (5, 6, 7)") .where("nivel_de_instruc_mais_elevad_para_o_fundam_com_duracao_9_anos IN (5, 6, 7)")
.where("ano_ref >= 2019") .where("ano_ref >= 2019")
.group("ano_ref"); .group("ano_ref")
.order("ano_ref");
req.querySet.push(totalPopEdBasMaior19); req.querySet.push(totalPopEdBasMaior19);
req.querySet.push(totalPopMaior19); req.querySet.push(totalPopMaior19);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment