zzzeek / sqla_issue_test

1 stars 0 forks source link

Need is or i NULL operator for where clause #187

Closed zzzeek closed 6 years ago

zzzeek commented 18 years ago

Originally reported by: Anonymous


Subj. sql operators =, in and others don't take me need results if I want to write something like

select * from tbl where col is NULL;

I can use instead op method from CompareMixin but I think explicit null check will be good solution


zzzeek commented 18 years ago

Original comment by Michael Bayer (Bitbucket: zzzeek, GitHub: zzzeek):


this has always been available like the following:

    table.select(table.c.column == None)

which creates an IS NULL clause.

however, it probably wasnt documented so clearly. so in changeset:1496, changeset:1497, i added a doc for it. you can also do

   table.select(table.c.column == null())

now.