使用ifnull()

select ifnull(sum(pay_price),0) as num from wm_order where pay_status=1 and pay_time between 1543766400 and 1543852800;
原文地址:https://www.cnblogs.com/javalinux/p/15384324.html