早教吧 育儿知识 作业答案 考试题库 百科 知识分享

microsoftaccess算selecttop运行不了,1.Prepareareportthatidentifiesthefivemostexpensivebicycles.Thereportshouldlistthebicyclesindescendingorderfrommostexpensivetoleastexpensive,thequantityonhandforeachmandthemarku

题目详情
microsoft access 算select top运行不了,
1.Prepare a report that identifies the five most expensive bicycles.The report should list the bicycles in descending order from most expensive to least expensive,the quantity on hand for eachm and the markup percentage for each.
要求是做一个报告,报告中要求有商品(自行车)从最贵到最便宜降序排列,还要有其他表中元素,这些我都能做出查询,但我做不出在这个基础上的查询从30个自行车仲只选五个最贵的,我知道应该用select top,但是混合起来不会用.目前sql如下:
SELECT [Product Table].[Product Name],[Product Table].[Selling Price],[Product Table].[Quantity on Hand],([Selling Price]-[Purchase Cost])/[Purchase Cost] AS [markup percentage]
FROM [Product Table]
ORDER BY [Product Table].[Selling Price] DESC;
求改正~
那如果是按quantity on hand来排前五个呢?按([Selling Price]-[Purchase Cost])/[Purchase Cost] AS [markup percentage]排前五呢?能做么?
回头一共给你加20分~
▼优质解答
答案和解析
SELECT Top 5 Product Name, Selling Price, Quantity on Hand, (Selling Price-Purchase Cost)/Purchase Cost AS markup percentage
FROM Product Table
ORDER BY Selling Price DESC