Microsoft Access中的SQL查询

时间:2016-02-27 20:07:55

标签: sql ms-access

我有一个编写查询的任务,使用northwind 2007数据库获取烘焙食品和干果和坚果中所有产品的产品名称,库存数量,类别和单价。我的查询如下:

SELECT PRODUCT_NAME, QUANTITY_PER_UNIT, CATEGORY, LIST_PRICE
FROM PRODUCTS
WHERE CATEGORY = [Dried Fruits & Nuts] OR [Baked Goods & Mixes];

有人能帮我这个吗?

1 个答案:

答案 0 :(得分:0)

大概:

SELECT 
    PRODUCT_NAME, QUANTITY_PER_UNIT, CATEGORY, LIST_PRICE
FROM 
    PRODUCTS
INNER JOIN 
    CATEGORIES ON PRODUCTS.CATEGORYID = CATEGORIES.CATEGORYID
WHERE 
    CATEGORIES.DESCRIPTION = "Dried Fruits & Nuts" 
    OR 
    CATEGORIES.CATEGORY = "Baked Goods & Mixes";