【发布时间】:2017-12-08 14:21:56
【问题描述】:
我一直在为以下工作进行 SQL 工作。我可以使用“AND”为以下内容编写查询,但我可以在查询中使用“至少”。
找出供应红色部分和绿色部分的供应商。
Select s.sid from suppliers s, catalog c, parts p
where s.sid=c.sid and c.pid=p.pid and p.color='Red'
intersect
Select s.sid from suppliers s, catalog c, parts p
where s.sid=c.sid and c.pid=p.pid and p.color='Green';
如何使用atleast 为类似的问题编写查询
“找出供应至少两个红色部件和至少两个绿色部件的供应商。”
【问题讨论】:
标签: mysql