> That said, constraints go in the WHERE clause. JOIN conditions go in > the JOIN clause.
Not necessarily. My personal thinking was that it doesn't matter where you put your join conditions - in WHERE clause or in JOIN clause. And I've always put these condition into WHERE clause because it was easier for me to read such queries then. Of course I had to make some workarounds for such cases as OP's (I've written things like "column is null or column = something") and for example Oracle even has special syntax of WHERE clause for such cases. But if described behavior is standard for SQL (which sounds reasonable for me although I don't know it for sure) then it can make a lot of queries easier. Pavel On Mon, Oct 5, 2009 at 8:18 AM, P Kishor <punk.k...@gmail.com> wrote: > On Mon, Oct 5, 2009 at 7:02 AM, Tim Lind <timl...@iafrica.com> wrote: >> Hi >> >> I have a query that is using a left join, with a where clause, and the >> results I expect are not returned because the one table doesn't have a >> related record. >> If I put the constraint in the on clause of the query instead, the >> expected results are returned with the null record of the related table. >> >> Is this standard behaviour of SQL or specific to SQLite? > > what is the schema? > what is the query? > what is the result you expect? > what is the result you actually get? > what changes do you make to your query to get what you want? > how can we read your mind? > > That said, constraints go in the WHERE clause. JOIN conditions go in > the JOIN clause. > > > -- > Puneet Kishor > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users