SELECT Categories.CategoryName, Products.ProductName, Sum(CCur([Order Details].UnitPrice*[Quantity]*(1-[Discount])/100)*100) AS ProductSales, "Qtr " & DatePart("q",[ShippedDate]) AS ShippedQuarter FROM (Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID) INNER JOIN (Orders INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order Details].ProductID WHERE (((Orders.ShippedDate) Between #1/1/1997# And #12/31/1997#)) GROUP BY Categories.CategoryName, Products.ProductName, "Qtr " & DatePart("q",[ShippedDate]); 这个SQL是PRODUCT SALES IN 1997里的查询语句. 偶想请教两个问题 1,这个子表在查询中起到什么作用,为什么不用JOIN将进行联合查询,子表有什么好处和优势? 2,Sum(CCur([Order Details].UnitPrice*[Quantity]*(1-[Discount])/100)*100) AS ProductSales 这个句子中CCur帮我解释一下,不太懂. 谢谢!哪位高人愿意帮肋我学习ACCESS啊?我刚学,比较笨,需要高人点拨啊.
[此贴子已经被作者于2006-6-28 17:12:59编辑过] |