a problem with left join

"Abaco Informática S.A." <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Message-ID <003c01c3619b$61772810$e02a46c8@internet2>
look at this scripts:

CREATE TABLE T1 (COD_1 FIXED(4), VAL_1 FIXED(4))
CREATE TABLE T2 (COD_2 FIXED(4), VAL_2 FIXED(4))
CREATE TABLE T3 (COD_3 FIXED(4), VAL_3 FIXED(4))
INSERT INTO T1 VALUES (1,1)
INSERT INTO T1 VALUES (2,2)
INSERT INTO T1 VALUES (3,3)

INSERT INTO T2 VALUES (1,1)
INSERT INTO T2 VALUES (2,2)

nothing for T3.

SELECT * FROM T1 LEFT JOIN T2 ON (VAL_1 = COD_2)           

result 3 rows (third row null in val_2,cod_2, it's work fine)

SELECT * FROM T1 LEFT JOIN T2 ON (VAL_1 = COD_2)  LEFT JOIN T3 ON (VAL_2 = COD_3)

result 2 rows  !!???


i think find 3 row with nulls in the columns of 3rd. table but the row with nulls in T2 disappear, what i doing wrong.

tia.
Ricardo Solanilla
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.