我一直试图找出如何在sql中编写此查询.
我需要的是找到有50个或更多订单的产品名(在产品表中)(在订单表中).
只有一个orderid一次与一个productname匹配,因此当我尝试计算orderid时,它会计算所有这些.
我可以获得不同的产品名称,但是一旦我添加了orderid,它就会回到拥有多个产品名称.
我还需要计算订购这些产品的客户数量(在订单表中).
我尽快得到一些认真的帮助!如果有人能帮助我弄清楚如何弄明白这将是非常棒的!
Table: Products
`productname` in the form of a text like 'GrannySmith'
Table: Orders
`orderid` in the form of '10222'..etc
`custid` in the form of something like 'SMITH'
Run Code Online (Sandbox Code Playgroud) sql ×1