【发布时间】:2015-12-16 10:54:03
【问题描述】:
我要执行的查询是: 多少车辆可用于服务货物 x?|
有什么想法吗?? 我有:
select count(VehicleType) from Vehicle where in
(select VEHICLETYPE, SHIPMENT_TYPE from can_carry
where SHIPMENT_TYPE in
(select SHIPMENT_TYPE from Shipment where ContractNo = x and ShipmentNo = x );
但我觉得不对
【问题讨论】:
-
在 WHERE 和 IN 之间缺少某些东西。 (根据 SQL 验证器,developer.mimer.com/validator/parser200x/.)
-
你不能在 can_carry 桌子上数一数吗?有点像这样
select count(VEHICLETYPE) from can_carry where can_carry.SHIPMENT_TYPE in (select SHIPMENT_TYPE from Shipment where ContractNo = x and ShipmentNo = x )