0
我正在写一个选择查询,在哪里条件我想检查一个字段值,如果它为空,那么只有我会其他字段值。请注意,select用于游标。选择查询不给予想要的结果
原始查询:
SELECT ni.node_installation_id,ni.customer_node_id,ni.customer_id,c.brand_name_1,substr(nitr.name,1,instr(nitr.name, ' ')-1) as node_inst_type
from node_installation ni , customer c , node_inst_type_release nitr
where ni.customer_id = c.customer_id
and ni.node_inst_type_release_id = nitr.node_inst_type_release_id
**and trunc(sysdate) - trunc(ni.arne_timestamp) >= 60**
and ni.no_of_collection_node_missed >= 4
and c.customer_id =90;
参考在大胆的声明,如果ni.arne_timestamp为空,结果也为空。在这种情况下,我想检查其他条件,如ni.arne_flag ='我',并采取选择查询这些行。希望这一次我很清楚。
您在使用此产品cartisian from子句中使用左联接,而不是 –
滚装原因是因为你正在编写古老的SQL。如果你使用ANSI92(1992!)语法,你可能会发现这个问题会神秘地消失,或者说明白。 – podiluska