chokka
asked on
Using left outer join in SQL
select table1.column_id,
table1.column_type,
table2.column_name
from table1
left outer join table2
on table1.column_type = table2.column_numb
In Table 1
column_id column_type
1 NULL
2 NULL
3 300
In Table 2
table2_column_id column_numb column_name
1 100 ABC
2 200 DEf
3 300 GHI
Expected value
column_id column_type column_name
1 NULL NULL
2 NULL NULL
3 300 GHI
My query is not picking the NULL Values. What could be the reason ??
table1.column_type,
table2.column_name
from table1
left outer join table2
on table1.column_type = table2.column_numb
In Table 1
column_id column_type
1 NULL
2 NULL
3 300
In Table 2
table2_column_id column_numb column_name
1 100 ABC
2 200 DEf
3 300 GHI
Expected value
column_id column_type column_name
1 NULL NULL
2 NULL NULL
3 300 GHI
My query is not picking the NULL Values. What could be the reason ??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try the example that I posted
can you post data type for the columns in your table? or table structure?
can you post data type for the columns in your table? or table structure?
ASKER
@Eugenez, Thanks !! My syntax is correct, but some conditional filtration filters the NULL Value column. Thank you for checking !!
ASKER
i implemented same logic query in my production database, but records with null value is filtered.