"Jay Sprenkle" <[EMAIL PROTECTED]> writes: >> What I think you're really asking, though, is about the rows that are NOT >> returned because there are null values. To fix that, you're probably looking >> for LEFT OUTER JOIN: > > Huh? I thought left join and left outer join were equivalent. > > SQLite version 3.0.8 > Enter ".help" for instructions > sqlite> create table x( id int, text char(8) ); > sqlite> insert into x values(1,'one'); > sqlite> insert into x values(2,'two'); > sqlite> insert into x values(3,'three'); > sqlite> create table y( id int, text char(8) ); > sqlite> insert into y values(3,'three'); > sqlite> select * from x inner join y on y.id = x.id; > 3|three|3|three > sqlite> select * from x left join y on y.id = x.id; > 1|one|| > 2|two|| > 3|three|3|three > sqlite> select * from x left outer join y on y.id = x.id; > 1|one|| > 2|two|| > 3|three|3|three > sqlite>
It looks like a bad recollection on my part. I've always remembered that LEFT JOIN was equivalent to LEFT INNER JOIN so I've always specified LEFT OUTER JOIN when I wanted that. (It's probably clearer to specify it anyway, I guess.) They say that memory is the second thing to go. I can't remember what the first is. :-) Derrell