Paul's Programming Notes     Archive     Feed     Github

NULL values excluded from NOT IN - SQLAlchemy+SQLite

Solution: AND column IS NOT NULL

Example: query.filter(or_(~self.column.in_(value), self.column == None))

This thread explains "SQL Server in treating NULL as a value": http://stackoverflow.com/questions/11491831/null-values-are-excluded-why