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

226
Vistas
How to display an inner join table

I've been trying to create an inner join between two table inside a db and display the joined table inside postman (I'm working on some js backend stuff). I know how to create the inner join using the SQL Shell but when I try to implement it, I get an empty answer from the server.

queries.js file:

const getOwnedCars = "SELECT * FROM users JOIN cars ON users.car_id = cars.id";

module.exports = {
    getOwnedCars,
};

routes.js file:

const {Router} = require('express');
const controller = require('./controllers'); 

const router = Router();

router.get('/ownedCar', controller.getOwnedCars);


module.exports = router;

constroller.js file:

const pool = require('../../../db');
const queries = require('./queries');

const getOwnedCars = (req,res) => {
    pool.query(queries.getOwnedCars, (error, results) => {
        if (error) throw error;
        res.status(200).json(results.rows);
    })
};

module.exports = {
    getOwnedCars,
};

the result I get when I try to access to the owned car page. If you need any other informations feel free to ask :) result from postman

thank you guys

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