问题标题:
microsoftaccess算selecttop运行不了,1.Prepareareportthatidentifiesthefivemostexpensivebicycles.Thereportshouldlistthebicyclesindescendingorderfrommostexpensivetoleastexpensive,thequantityonhandforeachmandthemarku
问题描述:
microsoftaccess算selecttop运行不了,
1.Prepareareportthatidentifiesthefivemostexpensivebicycles.Thereportshouldlistthebicyclesindescendingorderfrommostexpensivetoleastexpensive,thequantityonhandforeachmandthemarkuppercentageforeach.
要求是做一个报告,报告中要求有商品(自行车)从最贵到最便宜降序排列,还要有其他表中元素,这些我都能做出查询,但我做不出在这个基础上的查询从30个自行车仲只选五个最贵的,我知道应该用selecttop,但是混合起来不会用.目前sql如下:
SELECT[ProductTable].[ProductName],[ProductTable].[SellingPrice],[ProductTable].[QuantityonHand],([SellingPrice]-[PurchaseCost])/[PurchaseCost]AS[markuppercentage]
FROM[ProductTable]
ORDERBY[ProductTable].[SellingPrice]DESC;
求改正~
那如果是按quantityonhand来排前五个呢?按([SellingPrice]-[PurchaseCost])/[PurchaseCost]AS[markuppercentage]排前五呢?能做么?
回头一共给你加20分~
董入刚回答:
SELECTTop5ProductName,SellingPrice,QuantityonHand,(SellingPrice-PurchaseCost)/PurchaseCostASmarkuppercentage
FROMProductTable
ORDERBYSellingPriceDESC
查看更多