linking null records

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Hello experts.

I'm writing a query to join two tables. I'm linking columns in
each table with a one-to-one relationship.

As you probably know, linking columns with null record results returns
no records. Is there a way to change this? I.e., how do you match
null records?

Thanks for any help.
 
If you enter the SQL statement manually, it is possible to set up non-equi
JOINs:

SELECT Table1.*
FROM Table1 INNER JOIN Table2
ON ((Table.ID = Table2.ID) OR (Table1.ID Is Null AND Table2.ID Is Null));
 
If you enter the SQL statement manually, it is possible to set up non-equi
JOINs:

SELECT Table1.*
FROM Table1 INNER JOIN Table2
ON ((Table.ID = Table2.ID) OR (Table1.ID Is Null AND Table2.ID Is Null));
 
Probably just looking for outer joins?
SELECT Table1.*, Table2.*
FROM Table1 LEFT JOIN Table2
ON Table.ID = Table2.ID

or

SELECT Table1.*, Table2.*
FROM Table1 RIGHT JOIN Table2
ON Table.ID = Table2.ID

Pieter

who'd want a table with a null for ID <g>
 
Probably just looking for outer joins?
SELECT Table1.*, Table2.*
FROM Table1 LEFT JOIN Table2
ON Table.ID = Table2.ID

or

SELECT Table1.*, Table2.*
FROM Table1 RIGHT JOIN Table2
ON Table.ID = Table2.ID

Pieter

who'd want a table with a null for ID <g>
 
Back
Top