SELECT party_id, order_status, shipping_status, if(reserved_time>0, 'Y', 'N') as reserved_status, count(*)

from ecshop.ecs_order_info

GROUP BY party_id, order_status, shipping_status, reserved_status with ROLLUP