Hmmm...  That's not quite what I suggested.

I suggested WHERE NOT COLUMN = 'F'  which I think would result in the OP 
wants, True and NULL would be grouped together and False would be separate. 
 Or are you saying that web2py db adapters will take the construction 
~db.table.column=False and turn that into your construction below?

Warm regards,

Joe

On Thursday, August 8, 2013 5:57:44 AM UTC-7, Niphlod wrote:
>
> it would give the same result, its the exact same "mental-mistake"....
> if you negate the filter you get exactly what you would get negating the 
> operator
> i.e. WHERE NOT column = 'T'  matches exactly WHERE COLUMN <> 'T'
>
>
> a column holding a NULL value is "non-existant" for any (and I mean, 
> really any) where condition you may want to apply, except the specific ones:
> - IS NULL
> - IS NOT NULL 
>
> On Thursday, August 8, 2013 3:31:17 AM UTC+2, Joe Barnhart wrote:
>>
>> Not to be flip, but couldn't you just reverse the test and use 
>> ~(mytable.mybool==False)?  That would be false for False and true for True 
>> and None (NULL)
>>
>> But I agree it is an interesting find, and I will watch out for this in 
>> my own code.  Thanks for posting!
>>
>> -- Joe
>>
>> On Wednesday, August 7, 2013 2:00:42 PM UTC-7, Richard wrote:
>>>
>>> Hello,
>>>
>>> Found this not working :
>>>
>>> db((db.mytable.id == 1) & (db.mytable.mybool != True).select() 
>>>
>>> That translate as :
>>> SELECT * FROM mytable WHERE mytable.id = 1 AND mytable.mybool <> 'T'
>>>
>>> NO RECORD, BUT THERE IS A RECORD
>>>
>>> If i change the select like this :
>>> SELECT * FROM mytable WHERE mytable.id = 1 AND mytable.mybool IS NOT 
>>> TRUE
>>>
>>> I get my record.
>>>
>>> The issue seems to occure only when the "mybool" is NULL other then that 
>>> (TRUE or FALSE) I got my record...
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to