Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
Sequelize Query to get sum group by some specific values in one column

Model

const Productions=sequelize.define("Productions",{
        rpt_date:{
            type:DataTypes.DATE,
        },
        unit:{
            type:DataTypes.STRING,
            allowNull:false
        },
        commodity:{
            type:DataTypes.STRING,
            allowNull:false
        },
        quantity:{
            type:DataTypes.INTEGER,
        },
    })

    return Productions;
}

Inside unit field there are 8 values like

'KRB','MBR','GUA','MPR','BOL','BAR','TAL','KAL'.

I want to get sum of amount for any specific day by grouping the unit field for 'KRB', 'MBR', 'GUA', 'MPR' AS JGOM and 'BOL', 'BAR', 'TAL', 'KAL' AS OGOM

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda