Something like this would produce the query you want
```
DB.from(:films, :producers).where{ { producers[:name] => 'foo',
films[:producer_id] => producers[:id] } }
```

My Nguyen

On Fri, Oct 25, 2019 at 2:26 PM Nícolas Iensen <[email protected]>
wrote:

> Hey there,
>
> I would like to know how could one perform the following SQL query using
> the Sequel gem:
>
> DELETE FROM films
> USING producers
> WHERE producer_id = producers.id
> AND producers.name = 'foo';
>
> Thanks for your help :)
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/sequel-talk/9239a20e-f18a-4389-9b09-95e9736dee02%40googlegroups.com
> <https://groups.google.com/d/msgid/sequel-talk/9239a20e-f18a-4389-9b09-95e9736dee02%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CAHqpNqc7mt7R4OOiD73%2B_8r9xEJDPW9r6swavCR17CiO66Q_7A%40mail.gmail.com.

Reply via email to