On Tuesday, October 23, 2018 at 7:46:47 AM UTC-7, genc wrote:
>
> Hi Jeremy,
>
> I dig into querying.md and can't find any example about "NOT EXISTS".
>
> How can we write this query in Sequel:
>
> select * from books where not exists (select * from writers where .....)
>
>
I doubt NOT EXISTS would be documented explicitly.  However, you just need 
to combine the NOT with the EXISTS:

  DB[:books].exclude(DB[:writers].where(:foo).exists) 

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