Same query but differnt results:
I have the following script:
SELECT
ceil(sum(TO_NUMBER(p.NUM_OF_BEDSPACES))/3) HDE
FROM
BULL.RNT_PROPERTY_CHARGE_ITEM rpci,
BULL.PROP_STATUS_HIST prosh,
BULL.REP_PROPERTY rp,
BULL.PROPERTY p
WHERE (rpci.CHARGE_ITEM_CODE='HREN'
AND rpci.EFFECT_DATE<='&&AS_AT'
AND (rpci.END_EFFECT_DATE IS NULL OR rpci.END_EFFECT_DATE>'&&AS_AT')
and rp.bprn not in (852960,852996)
and rpci.chargeable_amount<>0
and p.dwelling_type_code<>'BSIT'
AND prosh.CODE in ('NLET','VAV','VUN')
AND (prosh.UPRN, prosh.DATE_STARTED) IN (SELECT psh.UPRN, MAX(psh.DATE_STARTED)
FROM BULL.PROP_STATUS_HIST psh
WHERE psh.DATE_STARTED<='&&AS_AT'
GROUP BY psh.UPRN))
AND prosh.UPRN=rp.UPRN
AND rpci.UPRN=rp.UPRN
AND p.UPRN=rp.UPRN
group by rp.bprn
when I run it from my oracle7 client on the 8i server it gives results
HDE
----
0
0
when I run it from my oracle7 client on the 7 server (same data - I am testing 8i) I get
HDE
-----
1
1
1
2
2
2
1
3
1
2
1
1
2
1
2
1
1
2
1
Is there any migration issues I should be aware of? Are functions treated differently in 8i (to_number, ceil, max)?
Is this a bug?
I have the following script:
SELECT
ceil(sum(TO_NUMBER(p.NUM_OF_BEDSPACES))/3) HDE
FROM
BULL.RNT_PROPERTY_CHARGE_ITEM rpci,
BULL.PROP_STATUS_HIST prosh,
BULL.REP_PROPERTY rp,
BULL.PROPERTY p
WHERE (rpci.CHARGE_ITEM_CODE='HREN'
AND rpci.EFFECT_DATE<='&&AS_AT'
AND (rpci.END_EFFECT_DATE IS NULL OR rpci.END_EFFECT_DATE>'&&AS_AT')
and rp.bprn not in (852960,852996)
and rpci.chargeable_amount<>0
and p.dwelling_type_code<>'BSIT'
AND prosh.CODE in ('NLET','VAV','VUN')
AND (prosh.UPRN, prosh.DATE_STARTED) IN (SELECT psh.UPRN, MAX(psh.DATE_STARTED)
FROM BULL.PROP_STATUS_HIST psh
WHERE psh.DATE_STARTED<='&&AS_AT'
GROUP BY psh.UPRN))
AND prosh.UPRN=rp.UPRN
AND rpci.UPRN=rp.UPRN
AND p.UPRN=rp.UPRN
group by rp.bprn
when I run it from my oracle7 client on the 8i server it gives results
HDE
----
0
0
when I run it from my oracle7 client on the 7 server (same data - I am testing 8i) I get
HDE
-----
1
1
1
2
2
2
1
3
1
2
1
1
2
1
2
1
1
2
1
Is there any migration issues I should be aware of? Are functions treated differently in 8i (to_number, ceil, max)?
Is this a bug?