Subject | Strange Query behaviour |
---|---|
Author | Leonardo Cosmai |
Post date | 2005-12-13T16:07:56Z |
Hi, I found that these two queries produce different results:
Query 1)
SELECT
ANA00.ANA00CODE A,
TAB00.TAB00TXT1 B,
TAB01.TAB00TXT1 C
FROM
ANA00
LEFT JOIN TAB00 ON (TAB00.TAB00CODE = ANA00.ANA00TREC AND
TAB00.TAB00TREC = 'TANA' AND TAB00.TAB00LNG0 = 'I')
LEFT JOIN TAB00 TAB01 ON (ANA00.ANA00TAB1 = TAB01.TAB00CODE AND
TAB01.TAB00TREC = 'BA11' AND TAB01.TAB00LNG0 = 'I')
A B C
---------------
1 null null
2 null null
Query 2)
SELECT
ANA00.ANA00CODE A,
TAB00.TAB00TXT1 B,
TAB01.TAB00TXT1 C
FROM
ANA00
LEFT JOIN TAB00 ON (TAB00.TAB00CODE = ANA00.ANA00TREC AND
TAB00.TAB00TREC = 'TANA' AND TAB00.TAB00LNG0 = 'I')
LEFT JOIN TAB00 TAB01 ON (ANA00.ANA00TAB1 = TAB01.TAB00CODE AND
TAB01.TAB00TREC = 'BA11' AND TAB01.TAB00LNG0 = 'I')
A B C
---------------
1 'A' null
2 'B' null
Is this the correct default behaviour?
--
Ciao
L.
Query 1)
SELECT
ANA00.ANA00CODE A,
TAB00.TAB00TXT1 B,
TAB01.TAB00TXT1 C
FROM
ANA00
LEFT JOIN TAB00 ON (TAB00.TAB00CODE = ANA00.ANA00TREC AND
TAB00.TAB00TREC = 'TANA' AND TAB00.TAB00LNG0 = 'I')
LEFT JOIN TAB00 TAB01 ON (ANA00.ANA00TAB1 = TAB01.TAB00CODE AND
TAB01.TAB00TREC = 'BA11' AND TAB01.TAB00LNG0 = 'I')
A B C
---------------
1 null null
2 null null
Query 2)
SELECT
ANA00.ANA00CODE A,
TAB00.TAB00TXT1 B,
TAB01.TAB00TXT1 C
FROM
ANA00
LEFT JOIN TAB00 ON (TAB00.TAB00CODE = ANA00.ANA00TREC AND
TAB00.TAB00TREC = 'TANA' AND TAB00.TAB00LNG0 = 'I')
LEFT JOIN TAB00 TAB01 ON (ANA00.ANA00TAB1 = TAB01.TAB00CODE AND
TAB01.TAB00TREC = 'BA11' AND TAB01.TAB00LNG0 = 'I')
A B C
---------------
1 'A' null
2 'B' null
Is this the correct default behaviour?
--
Ciao
L.