> …
> You could probably try:
>
>   ProcessModel.db.from(Sequel[:processes].as(:p1), 
> Sequel[:processes].as(:p2))
>
> Thanks,
> Jeremy
>

The generated SQL doesn't make sense, for both Postgres and MySQL:

ProcessModel.db.from{[Sequel[:processes].as(:p1), 
Sequel[:processes].as(:p2)]}.
    where{(p1[:app_guid] =~ p2[:app_guid]) & (p1[:created_at] < 
p2[:created_at])}.
    distinct.select{p1[:guid]}

maps to

#<Sequel::Mysql2::Dataset: "SELECT DISTINCT `p1`.`guid` WHERE (`processes` 
AS `p1` AND `processes` AS `p2` AND (`p1`.`app_guid` = `p2`.`app_guid`) AND 
(`p1`.`created_at` < `p2`.`created_at`))">

I think the problem is the lack of a FROM clause in the query.

This happens with both Postgres and MySQL

- Eric


-- 
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