postgresql 7.1 select shipping_method, coalesce(count(*), 0) as shipping_method_count from ec_orders_shippable where shipping_method not in ('no_shipping', 'pickup') and shipping_method is not null group by shipping_method