测试表: sms_log
查询短信日志表里总的发送短信量且了解超过64字的短信数量
select create_time::date as thedate,sum(ceil(length(content)/64.0))::integer,
sum(case when char_length(content)>64 then 1 else 0 end) as long_msg_num,'micro'::text as tag
from public.sms_log
where create_time>=date('2017-03-10')-1 and create_time<date('2017-03-13')
and content like '%abc%'
group by thedate;