Hi, I have a query with 2 subqueries, and no error message is reported, but, my problem is that the 2 subqueries do not follow the GROUP BY rule and show the total instead of by vendor...Code:SELECT Table1.agents AS Vendor, Count(Table1.carS) AS Car_Sold, Sum(Table1.carP) AS Car_Price, Count(Table1.busS) AS MortBus_Sold, Sum(Table1.busP) AS busPRice, (SELECT SUM(Table1.carS) FROM Table1WHERE (condition='Yes')) AS Car_bought_price, (SELECT COUNT(Table1.carB) FROM Table1 WHERE (condition='Yes')) AS Good_conditionFROM Table1WHERE (carS='Sold' Or busS=''Sold' ')GROUP BY Table1.agents ;
Table: Table1 Columns: agents = John, Bill, Frank... carS = Sold, Unsold carP = Car selling price busS = Sold, unsold busP = Bus selling price condition = Yes or No carB = car buying price
How can I fix this, please? Regards