我遇到了 Oracle SQL 的问题,错误是:
ORA-01427 单行子查询返回多于一行
我试图找到至少有一辆手动
变速箱车辆的位置,其里程低于任何豪华车那个位置。
这是我的桌子
VID MILEAGE LOCATION VSIZE TRANSMISSION
----------------------------------------------------------------------
V-101 70 AHMD COMPACT AUTOMATIC
V-102 50 SURAT COMPACT AUTOMATIC
V-103 10 AHMD MID-SIZE MANUAL
V-104 30 AHMD MID-SIZE AUTOMATIC
V-105 15 VADODARA FULL-SIZE AUTOMATIC
V-106 20 AHMD LUXURY AUTOMATIC
V-107 50 AHMD LUXURY MANUAL
这是我的查询:
SELECT location, transmission, mileage FROM vehicles_workshop
WHERE transmission = 'MANUAL' AND mileage =
( SELECT DISTINCT mileage FROM vehicles_workshop WHERE mileage <
(SELECT MAX(mileage) FROM vehicles_workshop WHERE vsize = 'LUXURY')
);