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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:08:01+00:00 2026-05-29T10:08:01+00:00

Sometime during joining couples tables i seen that condition criterias placed are inside ON()

  • 0

Sometime during joining couples tables i seen that condition criterias placed are inside ON() clause, and sometime out of it, means after WHERE.

What approach is more optimized and faster in big amount of data ?

What will be faster
1.

SELECT a.column1, b.column2
FROM tablea a
JOIN tableb b
ON a.column3 = b.column3 
WHERE b.column2='Y' AND a.column1='N'

or this one
2.

SELECT a.column1, b.column2
FROM tablea a
JOIN tableb b
ON (a.column3 = b.column3 AND b.column2='Y')
WHERE  a.column1='N'
  • 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-29T10:08:01+00:00Added an answer on May 29, 2026 at 10:08 am

    There are two ways of joining:

    1/ SQL-89-style, using comma separated tables and the WHERE clause

    Example:

    SELECT a.column1, b.column2
    FROM tablea a, tableb b
    WHERE a.column3 = b.column3
    

    2/ SQL-92-style, using the JOIN ... ON clause

    Example:

    SELECT a.column1, b.column2
    FROM tablea a
    JOIN tableb b
    ON a.column3 = b.column3 
    

    The 92 style is more modern and is preferred, because the join is actually much more visible when reading the query. You can mix both styles, and it will work, but that is a terrible idea.

    About performance, I can not do better than an already existing answer on Stackoverflow. I will quote the gist of it:

    According to “SQL Performance Tuning” by Peter Gulutzan and Trudy
    Pelzer, of the six or eight RDBMS brands they tested, there was no
    difference in optimization or performance of SQL-89 versus SQL-92
    style joins
    . One can assume that most RDBMS engines transform the
    syntax into an internal representation before optimizing or executing
    the query, so the human-readable syntax makes no difference.

    (emphasis mine)

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

Sidebar

Related Questions

I have a master-master replication setup and just found out that sometime during the
I have a custom ViewGroup (blue background) that when touched sometime during the app's
I know it happens sometime before Load, but during what event exactly?
Sometime I see many application such as msn, windows media player etc that are
This is a question that has been bothering me for sometime. My application uses
during my development in android I've missed a function that can log every broadcast
I have a class that might throw any run-time exceptions during initialization. I want
During a typical day programming, I implement functions in a way that I would
There is a particular registry value that my application sometimes creates during execution, i.e.
I have to download some URLs, and it can happen that during the operations

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.