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

  • SEARCH
  • Home
  • 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 8788653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:11:38+00:00 2026-06-13T22:11:38+00:00

Do the queries do the same? What is the standard? Will I lose performance

  • 0

Do the queries do the same? What is the standard?

Will I lose performance if I change one of these ways of write the query?

Query 1

   SELECT a.*, b.id AS b_id
     FROM table_a AS a
LEFT JOIN table_b AS b
       ON a.id = b.id

Query 2

   SELECT a.*, b.id AS b_id
     FROM table_a a, table_b b
    WHERE a.id = b.id
  • 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-06-13T22:11:39+00:00Added an answer on June 13, 2026 at 10:11 pm

    They return different results.

    A LEFT JOIN statement will return rows even if there is no associated records in table_b that match table_a id. So it will return all rows in table_a, paired with EITHER a matching row in table_a OR a blank/null table_b row (if for that row in table_a there isn’t any matching row in table_b).

    The second query is a shortcut for an INNER JOIN. This query will ONLY exclusively return rows that match the condition a.id = b.id. The second query can also be written as:

    SELECT a.*, b.id AS b_id
    FROM table_a a
    INNER JOIN table_b b 
    ON a.id = b.id
    

    To answer your performance question, please see the answers on a related SO thread here.

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

Sidebar

Related Questions

Can I write the same queries (select, insert, update etc.) in LINQ to Entites
Will the following media queries behave exactly same on mobile devices and computers or
I am moving a project from working with standard DB queries to working with
Please help to improve the following query: UPDATE queries q SET query = (SELECT
i got 2 mysql queries, that retrieve the same data?, what one do you
The following queries update the same table like 7 times.. I would appreciate your
I want to search two queries at the same time, such as macbook pro
Here are two queries that return the same resultset, but which is the optimal
I have two queries that produce the same columns but different rows. The first
I need to do two/three independent queries and load into the same viewmodel and

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.