0
SELECT p.Producttype, pp.ProductID, r.Date1, r.Date2
FROM customers AS c
INNER JOIN orders AS r ON c.Cusid = r.Cusid
INNER JOIN temporary AS temp ON r.Cusid = temp.Cusid
INNER JOIN products AS pp ON pp.ProductID = temp.ProductID
INNER JOIN Producttypes AS p ON p.Producttypeid = pp.Producttypeid
WHERE temp.Cusid = '23'
GROUP BY pp.ProductID
请帮助我不知道自己能做什么,该查询返回每次第一行到日期1和date2我的SQL每次返回第一行,
你能告诉你的表的样本。我不明白你的问题是什么 – usumoio 2013-04-25 00:17:12
对不起,我在这里是新的,问题是,每次查询返回所有行中的第一行,日期列中的所有行都具有相同的值 – marina 2013-04-25 00:19:31
@IamJohnGalt - 我同意他的看法。给我们一些样本数据。 – 2013-04-25 00:20:03