vendredi 29 juillet 2016

how to write SUM with Group by clause in SQL

SUM with Group by clause not working....

 $totdueamt=mysql_fetch_array(mysql_query("SELECT SUM(due_amount) as duedam FROM payments where branch='$duebid' and `due_date_bc` between '$frmdtdue' and '$todatdue' group by enq_id")); 

Aucun commentaire:

Enregistrer un commentaire