我有三个表:产品,库存和配料子查询的销售和库存
Product Table
ID[PK] Name Type
1 OrdinaryBurger Burger
2 CheeseBurger Burger
Inventory table
ID[PK] Item_name Stocks
100 Buns 5
101 Patties 5
103 Cheese 0
Ingredients table
ID[PK] ProductID[FK] InventoryID[FK] Quantity
1001 1 100 1
1002 1 101 1
1003 2 100 1
1004 2 101 1
1005 2 103 1
我想写一个查询,可以过滤所有产品如果连接库存量为0,则不显示,例如,由于奶酪库存为0,因此不会显示Cheeseburger。THanks
你到目前为止尝试过什么? –
数量1是什么意思?这不是金额,因为这将是5. – Eli
1数量意味着项目的数量将被应用在产品上,例如在普通的汉堡,你需要1个肉饼,1个包子 –