Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6670151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:14:04+00:00 2026-05-26T03:14:04+00:00

I have two mysql tables that I am querying together and the query works

  • 0

I have two mysql tables that I am querying together and the query works fine. The tables are car and requests

The problem is that i need both the auto increment id’s and it only gives me one.

The one it gives me is not the joined tabled.

Here is my query so far

SELECT * FROM `car` INNER JOIN `requests` ON `car`.`make_id` = `requests`.`make_id` WHERE `car`.`user_id` =21

I just need to someway get the auto increment id of the requests table.

As always stack exchange is the best place to come for answers so thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:14:05+00:00Added an answer on May 26, 2026 at 3:14 am

    Just specify your query as this and you’ll get both but with different names:

    SELECT `car`.id AS car_id, `requests`.id AS request_id, * 
    FROM `car` 
    INNER JOIN `requests` ON `car`.`make_id` = `requests`.`make_id` 
    WHERE `car`.`user_id` =21
    

    Note that you will still have an ID column which SHOULD be the requests.id, just diregard it and use car_id and request_id…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have two mysql tables which are linked together and i need to show
I have a two mysql tables that I want to merge together in one
I have a query that looks at partial matches within two mysql tables to
I was thinking that I would have two tables for mysql. One for storing
I have two MySQL tables (product and price history) that I would like to
If I have two tables in mysql that have similar columns... TABLEA id name
I need a query that loops data from two tables. The two tables I
I have two MySQL (MyIsAm) tables that represent letting units and bookings: LettingUnits (
I have two mysql tables, courses and student_courses, I need to get unique course_names
I have two MySQL database tables that are meant to hold data for eshop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.