由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - Oracle query 求助
相关主题
[Mysql] how to return NULL count in group by query问一下SQL in Python。
问一个数据库的题How to communicate between R and Access
SAS读取Oracle里面 Table 或者 Query的结果Import data in R
在实际工作MySQL query optimization的问题SQL 有证书考试吗?
Apple 电话面试 面经用SQL或者ACCESS来做Query design/data extraction
昨天考了SAS ADVANCED,不难看世界杯,有没有做SAS的同学?? (转载)
[合集] 请EXCEL 高手指点有没有做SAS的同学?我能帮着推荐一下 (转载)
update (some interview experiences)--急,面试求助:用ACCESS请问:query about checking consistency (转载)
相关话题的讨论汇总
话题: null话题: name话题: city话题: table话题: tom
进入Statistics版参与讨论
1 (共1页)
x******l
发帖数: 39
1
I have a table a
ID | Name | City
1 |Jack | Null
2 |Tom | Null
And table b
ID | Name | City
1 |Jack | Dever
2 |Tom | Dallas
I need to write a query to join these two tables by id, name and city if
they are not null in table a. But any of these three column could be null
for each row.
I wrote one below but the performance is bad when data grows
Select * from a, b
Where (a.id is not null and a.id=b.id or a.id is null) and
(a.name is not null and a.name=b.name or a.name is null) and
(a.city is not null and a.city=b.city or a.city is null)
Basically, I need to join on the column when it is not null in table a.
Could you shed some light on this?
Thanks a lot!
1 (共1页)
进入Statistics版参与讨论
相关主题
请问:query about checking consistency (转载)Apple 电话面试 面经
请大侠指教,在R 里面run query的问题。昨天考了SAS ADVANCED,不难
面试的SQL问题一般问些啥?[合集] 请EXCEL 高手指点
reporting analyst面试的问题回答update (some interview experiences)--急,面试求助:用ACCESS
[Mysql] how to return NULL count in group by query问一下SQL in Python。
问一个数据库的题How to communicate between R and Access
SAS读取Oracle里面 Table 或者 Query的结果Import data in R
在实际工作MySQL query optimization的问题SQL 有证书考试吗?
相关话题的讨论汇总
话题: null话题: name话题: city话题: table话题: tom