0

不幸的是,表结构已更改,为 1.4 MySQL 查询“按国家和州/省的销售报告”提供了一个解决方案。有人知道在 1.7.0.2 中按州订购销售的查询吗?我将不胜感激。

4

1 回答 1

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
于 2013-09-06T22:02:28.757 回答