Sequel is a simple, flexible, and powerful SQL database access toolkit for Ruby. Sequel provides thread safety, connection pooling and a concise DSL for constructing SQL queries and table schemas.
select cast(sum(case when datediff(month, last_purchase_date, @current_date) >= 6 then 1 else 0 end) * 100.0 / count(*) as decimal(10,2)) AS churn_rate_pct ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results