【发布时间】:2015-11-18 06:10:04
【问题描述】:
我的第一个查询返回值 20:
SELECT numberofseats
from plane
where tail number in
( select flighttailnumberfk
from flight
where departuretime between '11/29/2014' and '11/30/2014' and
flightdepartureairportfk = 'jfk' and
flightarrivalairport = 'mli'
)
我的第二个查询返回 1:
select count(reservationseatfk)
from flight f, reservation r
where f.departuretime between '11/29/2014' and '11/30/2014' and
f.reservationflightidfk = f.flightid and r.reservationdeparturetimefk = f.departuretime
现在我的问题是我想从第二个查询中减去第一个查询并给我答案 19。我该怎么做?
【问题讨论】:
-
您使用的是哪个 DBMS?
'11/29/2014'不是(标准)SQL 中的有效日期文字