On Thursday, March 7, 2019 at 4:04:28 AM UTC-8, Quackerjack wrote:
>
> In addition `.exclude` is also not working:
>
> irb(main):045:0> DB_OVS[:xxx].exclude(ausleuchtung_vorhanden: "ja").count
> => 17
> irb(main):046:0> DB_OVS[:xxx].exclude(ausleuchtung_vorhanden: "ja").sql
> => "SELECT * FROM [xxx].[xxx] WHERE ([AUSLEUCHTUNG_VORHANDEN] != N'ja')"
>
>
 If you are expecting results where AUSLEUCHTUNG_VORHANDEN has a NULL 
value, that you probably need to understand 3-valued boolean logic:

  TRUE => TRUE
  FALSE => FALSE
  NULL => NULL
  NOT (TRUE) => FALSE
  NOT (FALSE) => TRUE
  NOT (NULL) => NULL

If you want values  where AUSLEUCHTUNG_VORHANDEN has a NULL value or a 
non-NULL value that is not "ja"

  DB_OVS[:xxx].exclude(ausleuchtung_vorhanden: "ja").or(ausleuchtung_vorhanden: 
nil)

If this is not about NULL values, can you let me know why you think this is 
not working? 

Thanks,
Jeremy

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

Reply via email to