user4fun Posted September 28, 2009 Share Posted September 28, 2009 I need to write a query statment that will do the following$sql1="Select PK_BusinessID FROM tblBusiness where FK_AccountID ='$ses_var_PKAccountID' ";The trick is I want to find the SUM(Max_Ad_Pts) FROM tblAd for every PK_BusinessID that is found from $sql1 and just return one results $total_Max_Pts.I would apprecaite any help I can get.Thank you Link to comment Share on other sites More sharing options...
justsomeguy Posted September 28, 2009 Share Posted September 28, 2009 $sql1="SELECT SUM(Max_Ad_Pts) FROM tblAd WHERE PK_BusinessID IN (Select PK_BusinessID FROM tblBusiness where FK_AccountID ='$ses_var_PKAccountID') "; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.