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;
Giving error Operand should contain 1 column(s)
Trying to fetch the appropriate loginid , company name , fa_name by grouping the lot and get max purchaseprice.
Please help. Thanks in advance
Your subselect can only have one value in select clause:
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;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.