【发布时间】:2014-11-06 03:28:09
【问题描述】:
sqlite 中是否有类似“only”的关键字?我必须写一个查询来显示只预订红船的水手姓名。所以我目前的查询是:
select s.sname
from sailor s, boat b, reservation r
where s.sname = r.sname
and b.bname = r.bname
and b.color = 'red';
上面查询的问题是它还显示了预定红色+其他颜色船的水手姓名。我的查询结果:
a reserve red boat
a reserve green boat
b reserve red boat
但它应该只显示b,因为他只预订红色船。
【问题讨论】: