本文介绍了连接包含空值的表列时出现问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的sql查询中,我必须联接6个以上的表才能选择一条记录.在此,某些表包含空值.由于此空值,我无法检索任何记录.

例如,

我的查询看起来像这样

Hi
In my sql query, I have to join more than 6 tables to select a record. In this some of the tables contains null values. Because of this null values i couldn''t retrieve any records.

For ex,

My query looks like this

Select columns from table1 join table2 on tabl1.c1 = table 2.c join table3 on table1.c2 = table3.c join table4 on table1.c3 = table4.c join table5 on table1.c4=table5.c  ........... where id=value

像这样.


在这里
---->在此行中在table1.c3上加入table4 = table4.c

table1.c3为空...所以我无法选择记录.

我的问题是,如果该列为空,则只需使用该记录返回空值.

like this.


Here
----> In this line join table4 on table1.c3 = table4.c

table1.c3 is null... So I am unable to select records.

My question is If that column is null then just return null values with that records.

How can i solve it?

推荐答案



这篇关于连接包含空值的表列时出现问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:00