473,383 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

null value in joins

4
i have two tables a1 and b1. they have a common column which is not having any constraints... they have null values... when i use a join between the two columns the null values are neglected... how do i include the null values in the joins...

need help
r -neel
Apr 12 '07 #1
1 10375
chandu031
78 Expert
Hi,

If you are using an Inner join then obviously the NULLS are neglected( two nulls are not the same). If you want the NULLs also then you can do an OUTER join on the two tables. In your case it should be a FULL OUTER JOIN on the two tables.

SUPPOSE YOUR TABLES ARE LIKE THIS

A1:
COL1 COL2
------- -------
1 A
2 B
(null) C
(null) D

B1:
COL1 COL3
------- -------
2 b
3 c
4 d
1 a

and you are joining on col1 then a full outer join should return this result set:

COL2 COL3
------- -------
B b
A a
D (null)
C (null)
(null) d
(null) c


Hope this helps.........
Apr 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JBBHF | last post by:
Hi i'm working on a web project, and i would like to make my oracle query work in mysql. select match.numero "nummatch", to_char(match.datematch, 'yyyy-MM-dd') "datematch", p1.numjoueur "j1",...
3
by: Marcus | last post by:
I'm running into a situation that has me adding a value of "Unknown" to a reference table. I am being pulled between two trains of thought, and was curious to get other's input on in. I give an...
3
by: A.V.C. | last post by:
Hello, I want to store two information (so 2 columns) for 2/3rd of the rows that will be in a table and only one information (1 column is suffecient) for 1/3rd of the rows of the table. ex:...
5
by: Geremy | last post by:
Hi Consider two tables id1 code1 ----------- ----- 1 a 2 b 3 c id2 code2 value
3
by: Randall Skelton | last post by:
What is the storage cost of a null entry in a column? i.e. does a null entry of type integer, float8 or text consume the same amount of storage as one that is filled? I ask because I have...
8
by: wjdennis | last post by:
I'm looking at a table with two date/time columns in it. One colulmn has its Default Value set to Null, the other has nothing in the Default Value entry. What is the difference between these two...
5
by: perryche | last post by:
I am not sure if I am asking the right question in the subject here. But, here is my problem. I have 5tables/queries with various data like below. Table1: CustomerID1, Field1, Field2 Table2:...
36
by: TC | last post by:
I've used Access for many years. Several times, I've encountered a bug which I refer to as the "Vanishing Joins" bug. When it happens, joins vanish randomly from queries. More specifically, all...
2
by: ssouhrada | last post by:
Hello, I call a stored procedure via classic ASP (1.1). I loop through the results and print out items on a page. Pretty basic concept but what I'm finding is that if a row from the database...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.