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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:39:26+00:00 2026-05-16T07:39:26+00:00

DROP TABLE table1; DROP TABLE table2; CREATE TABLE table1 ( col1 NUMBER, col2 NUMBER,

  • 0
DROP TABLE table1;
DROP TABLE table2;

CREATE TABLE table1
(   col1  NUMBER,
    col2  NUMBER,
    col3  NUMBER,
    col4  NUMBER
);

CREATE TABLE table2
(   col1  NUMBER,
    col2  NUMBER,
    col3  NUMBER,
    col4  NUMBER
);

INSERT INTO TABLE1 VALUES (1,44,1,1);
INSERT INTO table1 VALUES (2,44,2,2);
INSERT INTO TABLE1 VALUES (3,44,3,3);

INSERT INTO table2  VALUES (1,44,11,11);
INSERT INTO TABLE2  VALUES (2,44,22,22);

-- Q1
SELECT t1.*, t2.* FROM table1 t1, table2 t2
WHERE t1.col1 = t2.col1(+);

-- Yields
-- col1 col2 col3 col4 col1_1   col2_1 col3_1 col4_1
      1   44    1    1      1       44     11     11
      2   44    2    2      2       44     22     22
      3   44    3    3      NULL   NULL  NULL   NULL


-- Q2
SELECT t1.*, t2.* FROM table1 t1, table2 t2
WHERE t1.col1 = t2.col1(+)
AND             t2.col1 IS NULL;

-- Yields
-- col1 col2 col3 col4 col1_1   col2_1 col3_1 col4_1
      3   44    3    3   NULL     NULL   NULL   NULL


-- Q3
SELECT t1.*, t2.* FROM table1 t1, table2 t2
WHERE t1.col2 = 44
  AND t2.col2 = 44 
  AND t1.col1 = t2.col1(+)
  AND           t2.col1 IS NULL;

-- Yields
-- col1 col2 col3 col4 col1_1   col2_1 col3_1 col4_1

-- No Rows.

COMMIT;
  • 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-16T07:39:27+00:00Added an answer on May 16, 2026 at 7:39 am

    Because t2.col1 IS NULL and t2.col2 = 44 will not both be true at the same time.

    If t2.col1 IS NULL, it means there was no match on the join, so t2.col2 will also be NULL.

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

Sidebar

Related Questions

This is what I have: drop table ttemp create table ttemp( col1 char(10), col2
DROP TABLE ( SELECT table_name FROM information_schema.`TABLES` WHERE table_schema = 'myDatabase' AND table_name LIKE
My intention is to insert data from source table into target table. Source table
I have the following table drop table names; create table names( name varchar(200), surname
I have the following table DROP TABLE IF EXISTS `test`.`foo`; CREATE TABLE `test`.`foo` (
DROP TABLE IF EXISTS student; CREATE TABLE student( bannerid VARCHAR(9) PRIMARY KEY NOT NULL
I have a testdata like this: DROP TABLE SELECT_PASS; CREATE TABLE SELECT_PASS(ID INT(20),TESTCASE VARCHAR(20),RESULT
I have the following script to create a table: -- Create State table. DROP
Rather than create, and then drop a table in sqlite3, I would like to
As we create and drop temporary tables, inserts data into those tables, the size

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.