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

224
Views
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
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!