SELECT t1.loginid,t1.`company_name`,t1.`FA_Name`,t1.`Lot`,t1.`PurchasePrice` FROM test_report t1
WHERE PurchasePrice IN (SELECT t1.loginid,t1.`company_name`,t1.`FA_Name`,t1.`Lot`,MAX(t1.`PurchasePrice`) FROM test_report t1 GROUP BY lot)
ORDER BY lot;
给出错误操作数应包含 1 列
尝试获取适当的登录ID,公司名称,fa_name通过分组批次并获得最大购买价格。
请帮忙。提前致谢
子选择在选择子句中只能有一个值:
SELECT t1.loginid,t1.`company_name`,t1.`FA_Name`,t1.`Lot`,t1.`PurchasePrice` FROM test_report t1
WHERE PurchasePrice IN (SELECT MAX(t1.`PurchasePrice`) FROM test_report t1 GROUP BY lot)
ORDER BY lot;