Hi,

Is it possible to write this query with Sequel?

    SELECT DISTINCT ON (x.e->>'email')
      x.e->>'email' as email,
      x.e->>'name'  as name
      FROM messages sr
      CROSS JOIN LATERAL jsonb_array_elements(sr.receiver)  x (e)
      ORDER BY x.e->>'email', id desc

Or I use *with_sql?*

Thanks!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/ef167f41-2fe9-4b97-b5c4-8e16058a1615%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to