国家在1.7.0.2的magento销售报告

时间:2013-04-03 00:54:18

标签: sql magento magento-1.7

为1.4 MySQL query for "Sales Report by Country and State/Province"提供了一个解决方案,遗憾的是表结构发生了变化。任何人都知道在1.7.0.2中按州订购销售的查询?我非常感激。

1 个答案:

答案 0 :(得分:1)

以下是我的想法:

SELECT
    sales_flat_order_address.region
    , count(*)
FROM 
    `sales_flat_order` AS `main_table` INNER JOIN `sales_flat_order_address` 
        ON main_table.entity_id = sales_flat_order_address.parent_id 
        AND sales_flat_order_address.address_type="shipping" 
GROUP BY
    sales_flat_order_address.region