พอดีต้องการจะ COUNT RECORD จากอีก TABLE โดยมีเงื่อนไขอ่ะคับ
Code
"SELECT MTH.MatchID, MTH.MatchType, MTH.MatchDate, MTH.NoOfStewardExp, MTH.NoOfStewardNonExp,"
+ "(SELECT COUNT(STW.StewardID) From Steward AS STW, Match AS MTH WHERE MTH.MatchID=STW.MatchID AND STW.StewardAllocation='Yes' AND STW.ExpType='Yes') AS MTH.ExpStewardAllocated,"
+ "(SELECT COUNT(STW.StewardID) From Steward AS STW, Match AS MTH WHERE MTH.MatchID=STW.MatchID AND STW.StewardAllocation='Yes' AND STW.ExpType='No') AS MTH.NonExpStewardAllocated"
+ "FROM Steward AS STW, Match AS MTH"
+ "WHERE MTH.MatchID=STW.MatchID AND MTH.MatchType='Home' ORDER BY MTH.MatchID ASC;";