query rows left join 不匹配ansi join equivalence rows

query rows left join does not match ansi join equivalence rows

晚上好,

我有 2 个查询 return 不同的行值,一个使用左连接语法,另一个使用旧 ansi

我需要在 oracle 中创建物化视图的语法。我需要将旧语法 value1 (+) 添加到

匹配第一个左连接查询(包括空值)。 非常感谢。

观察:出现错误是因为table“detalle_ordenes”有一个值在table“tabla_hija”。但是我 想要显示所有行而不像在左连接查询中那样过滤它

select  --(query number 1, returns 18 records.)
       o.rowid o_rowid,
       c.rowid c_rowid,
       e.rowid e_rowid,
       f.rowid f_rowid,
       ordenid,
      o.detalleid,
      o.productoid,
       f.vdescricion as v2descripcion
    from detalle_ordenes o
    left join tabla_hija c on o.estado=c.vvalor and c.tipo_filtro=1 
    left join tabla_hija e on o.segmento=e.vvalor and e.tipo_filtro=2
    left join tabla_hija f on o.column1=f.vvalor and f.tipo_filtro=3

select --(query number 2, returns 15 records.)
   o.rowid o_rowid,
   c.rowid c_rowid,
   e.rowid e_rowid,
   f.rowid f_rowid,
   ordenid,
   o.detalleid,
   o.productoid,
   f.vdescricion as v2descripcion
from detalle_ordenes o, tabla_hija c, tabla_hija e,tabla_hija f
where
   ( o.estado=c.vvalor(+) and c.tipo_filtro=1 )
   and
   ( o.segmento=e.vvalor(+) and e.tipo_filtro=2) 
   and 
   ( o.column1=f.vvalor(+) and f.tipo_filtro=3) 

(+)添加到外部联接过滤器中的所有条件:

select *
from   detalle_ordenes o,
       tabla_hija c,
       tabla_hija e,
       tabla_hija f
WHERE  o.estado   = c.vvalor (+)
AND    1          = c.tipo_filtro (+) 
AND    o.segmento = e.vvalor (+)
AND    2          = e.tipo_filtro (+) 
AND    o.column1  = f.vvalor (+)
AND    3          = f.tipo_filtro (+)

db<>fiddle here