Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!