On 01/11/2019 16:20, Simon Slavin wrote:
It is actually
WHERE (c1 IS NULL) OR (C1 != 2)
which could quite reasonably return rows.

Yes, and with this OR filter the quoted example does indeed return rows. The version with:

    WHERE NOT (c1 IS NOT NULL AND c1=2)

*should* be equivalent to your version, but in 3.30 does not return the NULL values.

> You can't possibly mean to do that WHERE clause in production code

I might not spell it like that myself, but a code generator would do it (and much worse!). This example was simplified from a query generated by a Django ORM queryset using `.exclude(nullable_joined_table__column=1)`, for instance.

But yeah, expressions written in a less-than-tasteful style should probably still work as specified by SQL92. ;-)

--
And Clover
mailto:a...@doxdesk.com
https://www.doxdesk.com/
gtalk:chat?jid=bobi...@gmail.com

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to