"Cnichols" <cnichol...@gmail.com> wrote in message news:21685825.p...@talk.nabble.com > Stats does contain 46 qids with sids of 7 > there is one duplicate question now that i look harder in temp which > is ok because 289 I forgot to mention that id in temp is not a key, > this is because there is a test mode to ask random questions that > aren't unique (so 289 was asked twice). > > but if i did this > SELECT Count() FROM Stats S > LEFT JOIN Temp T ON T.Id = S.QuestionId > WHERE S.SessionId = 7 > > Shouldn't only still return 46 rows and not 51 since stats in on the > left and we are only getting associated data from the right?
LEFT JOIN produces all the same rows as INNER JOIN, plus some rows from left table that don't have a match in the right one. Thus, LEFT JOIN cannot possibly generate fewer rows than a corresponding INNER JOIN. I'm not sure why you expect it to. Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users