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

185
Views
Nombre relacionado con el filtro SQL usando javascript

Lo que hice hasta ahora es crear una consulta para obtener todos los autores, y creé una consulta para obtener todos los libros publicados por autores, mi problema es que no puedo filtrar qué autor publicó el libro en la transacción. Lo que quiero es contar todos los libros publicados por el autor en la transacción.

este es mi codigo

 const getAuthors = async ()=>{ return new Promise((resolve, reject)=>{ var author = (`SELECT id, name FROM Author`, 1000, data=>{ let obj = { authorsId: [] } for(let x = 0; x < data.length; x++){ obj.authorsId.push(data[x][0]); } console.log(obj) return resolve(obj); }) }) }

resultado de console.log(obj)

 { "authorsId": [ 1, 2, 3, 4 ] }

/

 const getAuthorPublished = async ()=>{ const authorsId = await getAuthors() return new Promise((resolve, reject)=>{ var bookpublished = (`SELECT exp_fAuthor, rAuthors, exp_fAuthor_Published_Book FROM KTMS_Transaction`, 1000, data=>{ let arrAuthorPublished = { authors: [], authorIds: [], counts: [] } for(let x = 0; x < data.length; x++){ arrAuthorPublished.authors.push(data[x][0]); arrAuthorPublished.authorIds.push(data[x][1]); arrAuthorPublished.counts.push(data[x][2]); } console.log("arrAuthorPublished: ", arrAuthorPublished) return resolve(arrAuthorPublished); }) }) }

//resultado de console.log(arrAuthorPublished)

 { "authors": [ "Claire", "Claire", "Yuno", "Claire" ], "authorIds": [ 440944522, 440944522, 440930072, 440944522 ], "counts": [ 1, 1, 1, 1 ] }
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!