Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

111
Vistas
I have to make changes in a logic where it fetches data from MySQL using certain conditions and I'm not sure how to do it?

Okay so first

async getPRMsAvailability() {
  var prmsData = await getManager().query(
    'SELECT SQL_NO_CACHE prm.id, prm.firstName, prm.lastName, COUNT(student.id) as students FROM prm LEFT JOIN student ON prm.id = student.prm_id group by prm.id order by count(student.id) asc limit 1'
  );

  return prmsData;
}

This is the code that is already present in my file what this code does is from the prm table it takes id, firstname, lastname and assigns it to the total count of student ids present in student table the only change I want here is that it should also consider the status column from the student table and only consider it for those students whose status(student.status) is active and not all students.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda