Hi all,
A few weeks ago I posted a question about a potential defect in Oracle 11g. Today I have more details on the error.
Please contact me if you are an Oracle Support engineer, I will like to follow up directly.
The first Query 1 returns the correct value
SELECT SUM(t.debitmst) 270
FROM
(
SELECT
SUBSTR(nls_lower(ledgeraccountnum), 1, 21) as account_substr,
SUM(debitmst) AS debitmst
FROM LEDGERBALANCESTRANSDELTA
GROUP BY ledgeraccountnum
) t;
The query 2 returns null (notice 21 became 20):
SELECT SUM(t.debitmst)
FROM
(
SELECT
SUBSTR(nls_lower(ledgeraccountnum), 1, 20) as account_substr,
SUM(debitmst) AS debitmst
FROM LEDGERBALANCESTRANSDELTA
GROUP BY ledgeraccountnum
) t;
This does not reproduce with Oracle 10g or SQL Server 2005/2008
Regards,
Bertrand