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 7908307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:53:02+00:00 2026-06-03T11:53:02+00:00

Is my understand of filtering joins using ON vs. WHERE correct? WHERE …will filter

  • 0

Is my understand of filtering joins using ON vs. WHERE correct?


WHERE

…will filter the result of the joined tables, meaning a LEFT JOIN or RIGHT JOIN won’t display all records in the intended table because they will be filtered out even though the WHERE filter might be on a field in the other table.

ON

…can be used as a filter for the table being joined. I used to think ON was only used to compare fields between two tables when joining them, but it can also act like an isolated WHERE for the specific table being joined.


None of this really matters when you are only joining two tables, but I have come to realize that understanding the difference is critical when doing very large joins across 3+ tables.

  • 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-03T11:53:03+00:00Added an answer on June 3, 2026 at 11:53 am

    The link @Gratzy provided is helpful

    The distinction between conditions in the ON clause and the WHERE clause is certainly a grey one.

    For INNER JOINS they are equivalent. For OUTER JOINS, your understanding is correct that the WHERE clause is conceptually applied after the ON condition has been evaluated.

    But in many cases the difference is more down to intent than functionality. There is often a semantic difference between the ON conditions and the WHERE clause.

    For example, older versions of SQL Server really did implement the ON syntax using conditions in the WHERE clause, employing a *= or =* syntax to imply LEFT or RIGHT joins (which led to oddly subtly different results form the LEFT and RIGHT JOIN equivalents in some cases)

    In general, my advice is always to use the appropriate key fields in the ON clause to join records based on the logic of how the records associate with each other. Use the WHERE clause to apply filtering conditions that progressively restrict this result set.

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

Sidebar

Related Questions

I understand the pros of using namespaces within the actual application layers but when
I am using meta_search to filter through a listing of cars. The car model
What is the best solution to form spoofing besides filtering the inputs? I understand
Hi We have some php code using the file_get_contents() function, and I understand this
I'm using named scopes to process some filtering actions, and the log is showing
Meh! Can't understand what happens here. The filter is correctly applied when used on
This drives me mad. I just can't understand it. I wrote a filter-function based
I didn't understand this. This is used for filtering case insensitive: jQuery.expr[':'].Contains = function(a,i,m){
I am using Duine for implementing Collaborative filtering/social filtering in java.There are 2 parameters
I understand the principles but i have a hard time seeing where the practical

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.