General Usage Filters

Apply filters using column references

You may apply filters using column references.

and_()Creates an AND SQL conditionand_(table.a > 23, table.b == u’blue’)
or_()Creates an OR SQL conditionor_(table.a > 23, table.b == u’blue’)
not_()Inverts the conditionnot_(and_(table.a > 23, table.b == u’blue’))
in_()Test if values are with a tuple of valuestable.column.in_((1, 2, 3))
notinInverts the IN conditiontable.column.notin((1, 2, 3))
any_()Applies the SQL ANY() condition to a columntable.column.any((‘red’, ‘blue’, ‘yellow’))
betweenApplies the SQL BETWEEN conditiontable.column.between(23, 46)
startswithApplies the SQL LIKE ‘%’table.column.startswith(‘abc’)
containsApplies the SQL LIKE ‘%%’table.column.contains(‘mno’)
endswithApplies the SQL LIKE ‘%%’table.column.endswith(‘xyz’)
is_Applies the SQL is the IS for things like IS NULLtable.column.is_(None)
isnotApplies the SQL is the IS for things like IS NOT NULLtable.column.isnot(None)
likeApplies the SQL LIKE‘%foobar%’’)
notlikeApplies the SQL NOT LIKE methodtable.column.notlike(‘%foobar%’)
ilikeApplies the SQL ILIKE methodtable.column.ilike(‘%foobar%’)
notilikeApplies the SQL NOT ILIKE methodtable.column.notilike(‘%foobar%’)
NULL, Null, nullAlias for Python None
TRUE, trueAlias for Python True
FALSE, falseAlias for Python False
>Greater Thantable.column > 23
<Less Thantable.column < 23
>=Greater than or equal totable.column >= 23
<=Less than or equal totable.column <= 23
==Equaltable.column == 23 table.column == ‘blue’
!=Not Equaltable.column != 23 table.column != ‘blue’
Last modified April 06, 2022 at 10:08 AM EST: Initial Documentation Commit (371ae8f)