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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:10:30+00:00 2026-06-17T05:10:30+00:00

SQL fiddle link for sample data Basically my doubt is , is it same

  • 0

SQL fiddle link for sample data

Basically my doubt is , is it same if we specify a condition in ON clause of LEFT OUTER JOIN or we specify condition in WHERE clause with null check ?

Table schema :

Create table App(ID number , STATUS varchar2(10));
Create table App_Child(child_id number ,
                       STATUS varchar2(10),
                       ID number );

Query 1

SELECT a.ID AS appID, a.STATUS AS appSTATUS,
b.child_id AS acOWNID,b.STATUS AS acSTATUS, b.id AS acID
 FROM App  a LEFT OUTER JOIN App_Child b ON (a.id=b.id AND b.STATUS <> 'disabled')  WHERE a.ID = ?;

Query 2

SELECT a.ID AS appID, a.STATUS AS appSTATUS,
b.child_id AS acOWNID,b.STATUS AS acSTATUS, b.id AS acID
 FROM App  a LEFT OUTER JOIN App_Child b ON (a.id=b.id)  WHERE a.ID = ? AND (b.STATUS IS NULL OR b.STATUS<>'disabled');
  • 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-17T05:10:31+00:00Added an answer on June 17, 2026 at 5:10 am

    Not not is the same neither in results and readability.

    • When you write condition in on clause you include all rows from App.
    • When you write condition in where clause you filter rows from result:

    In your case an App with row related with a App_Child with b.STATUS=’disabled’ will be filtered

    Here a sample:

    INSERT INTO App VALUES(1,'active');
    
    INSERT INTO App_Child VALUES(3,'disabled',1);
    
    SELECT a.ID AS appID, a.STATUS AS appSTATUS,
    b.child_id AS acOWNID,b.STATUS AS acSTATUS, b.id AS acID
     FROM App  a LEFT OUTER JOIN App_Child b 
          ON (a.id=b.id AND b.STATUS <> 'disabled')  
    WHERE a.ID = 1;
    
    --- has results ---
    
    SELECT a.ID AS appID, a.STATUS AS appSTATUS,
    b.child_id AS acOWNID,b.STATUS AS acSTATUS, b.id AS acID
     FROM App  a LEFT OUTER JOIN App_Child b ON (a.id=b.id)  
    WHERE a.ID = 1 AND (b.STATUS IS NULL OR b.STATUS<>'disabled');
    
    -- don't has results --
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQL: SELECT COUNT(*) FROM bb_posts post LEFT JOIN bb_topics topic ON topic.topic_id = post.topic_id
This seems weird: [SQL FIDDLE] The two users are definitely different i.e 1<>2. So
I have 4 MySQL Tables shown here: SQL Fiddle I need to select station
I have created my SQL Fiddle on the following URL for testing and building
Following in my sql fiddle: http://sqlfiddle.com/#!2/62429/2 I have a username , which i need
Please look at this SQL Fiddle for the tables and what query I have
Does SQL-fiddle facilitate execution of triggers/stored procedures? I have been unable to execute even
I have a few tables in my database and am using left outer joins
I have this sql table and rows defined in SQL Fiddle In SUPPLIER_DETAILS table
== SQL Fiddle of My Question Here I have the following tables related to

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.