There's an apparent bug in ingres version
patch seq version
12021 1 II 9.0.4 (a64.sol/105)
concerning outer joins.
The first statement below returns wrong data.
The columns involved in the joins are decimal(9, 2).
Any comments are welcome.
1> select first 1
p.id,
a.procent ,
a.fk_funduszid
from PRODUKT_UCZESTNIKA p
LEFT JOIN OKRES o ON o.fk_produkt_uczeid=p.id
LEFT JOIN ALOKACJA a ON a.fk_okresid =o.id
where a.procent is null
+----------+-------+-----------+
|id |procent|fk_funduszi|
+----------+-------+-----------+
| 1| | |
+----------+-------+-----------+
2> select
p.id,
a.procent ,
a.fk_funduszid
from PRODUKT_UCZESTNIKA p
LEFT JOIN OKRES o ON o.fk_produkt_uczeid=p.id
LEFT JOIN ALOKACJA a ON a.fk_okresid =o.id
where 1=1
and p.id=1
+----------+-------+-----------+
|id |procent|fk_funduszi|
+----------+-------+-----------+
| 1| 40,00| 163|
| 1| 30,00| 164|
| 1| 30,00| 161|
+----------+-------+-----------+
(3 rows)