我想在笨格式寫這篇以下查詢,並得到一些問題,聚合函數:在笨查詢
$stmt = "select sum(subscription_amt) as samt, bill_month,
sum(loan_refund_amt*no_of_loan_installment+error_amt) as lamt
from pf_bill_det
where trim(pf_number)='$pfno'
and fin_year='$fyear'
and aproved='Y' group by bill_month";
$query = $this->db->query($stmt);
這個查詢有錯誤loan_refund_amt*no_of_loan_installment+error_amt is not a column
結束了。請幫助我如何使用codeigniter查詢格式編寫此查詢。
嘗試'$ this-> db-> count();'counter函數在codeigniter中... – user2727841
請確保您的表中有這些列'loan_refund_amt * no_of_loan_installment + error_amt'或嘗試'loan_refund_amt * no_of_loan_installment + error_amt' –
檢查您在查詢中使用的表格列或在此處顯示錶格列 – NLSaini