SQL中两数相除保留两位小数的实现方法
程序员文章站
2023-11-11 13:01:22
sql中两数相除保留两位小数的实现方法
select agent_id,city_name,agent_name,
round(convert((sum(cont)-sum(before_co...
sql中两数相除保留两位小数的实现方法
select agent_id,city_name,agent_name, round(convert((sum(cont)-sum(before_cont)),signed)/convert(sum(before_cont),signed),2) as cont_increase from gt_report_receive_sort_week gt_report_receive_sort_month and datetime >= ${starttime} and datetime < ${endtime} and city_id = #{cityid} group by agent_id order by cont_increase desc asc limit 10