使用ifnull() select ifnull(sum(pay_price),0) as num from wm_order where pay_status=1 and pay_time between 1543766400 and 1543852800;