Can I Inner Join 2 tables based on multiple values for a column

流过昼夜 提交于 2019-12-24 08:22:40

问题


This is what I want,

TableA Inner Join TableB 
      on TableA.ColumnA = TableB.ColumnA OR TableB.ColumnA = NULL

It gives no results back, any alternative ?

Edit


回答1:


One issue in your query is TableB.ColumnA = NULL.

NULL is undefined and you cannot use comparison operators to check null.

Replace

TableB.ColumnA = NULL

With

TableB.ColumnA IS NULL

By looking at the picture description, I think you are looking for a LEFT/RIGHT JOIN.



来源:https://stackoverflow.com/questions/24733450/can-i-inner-join-2-tables-based-on-multiple-values-for-a-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!