On Thursday, October 11, 2018 at 2:14:58 AM UTC-7, Artur Trofimov wrote:
>
> Hello!
>
> Is subject realized in any plugin?
>
> I want to implement this SQL with Sequel
>
> count(DISTINCT lessons.id) FILTER (WHERE lessons.approved) AS 
> approved_lessons_count
>
> Inside of SELECT
>
>
No plugin or extension needed:

  
select{count(lessons[:id]).distinct.filter(lessons[:approved]).as(:approved_lessons_count)}

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