2017-03-10 10:17 GMT+13:00 Yasin Sari <yasinsari81@xxxxxxxxxxxxxx>:
if you want see account_status and the count()- try this:SELECTCASEWHEN AND c.regdate > EXTRACT(epoch FROM (now() - INTERVAL '14 day'))THEN 'trial'WHEN last_pay > EXTRACT(epoch FROM (now() - INTERVAL '37 day'))THEN 'paying'END as account_status,count(*)FROM public.clients cWHERE ((last_pay > EXTRACT('epoch' FROM now() - '12 Months'::INTERVAL)))group by 1ORDER BY 1
Thanks Yasin! That worked.
P.