MYSQL查询显示:每个客户的第一个订单


MYSQL query that displays: the first order for each customer

请帮帮我。。。基于Northwind数据库http://www.pilpoils.be/demos/northwind-db/assets/12f53c79/northwind.gif,我想编写一个MYSQL查询,显示:每个客户的第一个订单。我试过了,但有困难。。。这是我的问题:

select top 1 * from orders inner join customers on orders.customerid=customers.customerid

thnx到所有

SELECT * from Customers AS c 
    INNER JOIN `Orders` AS o ON c.CustomerID = o.CustomerID
    INNER JOIN 
        ( SELECT CustomerID, min(OrderDate) AS mod FROM `Orders` GROUP BY CustomerID ) AS mTable
        ON mTable.mod = OrderDate AND mTable.CustomerID = C.CustomerID;