0
私は複数の行にクエリを渡しています。どのようにこれらの行をグループ化して、いくつかの行の値を合計し、残りの行を残すことができます。複数の行を戻す副問合せの場合は、値を合計します。 (私の使用例は2行です)
set total_fees1 = (select (f.total_Fees2) from fee_Collection f where f.student_Id =minstudent_Id);
set total_fees2 = (select (f.total_Fees3) from fee_Collection f where f.student_Id =minstudent_Id);
set paid_amount1 = (select (f.paid_amount2) from fee_Collection f where f.student_Id =minstudent_Id);
set paid_amount2 = (select (f.paid_amount3) from fee_Collection f where f.student_Id =minstudent_Id);
これらのクエリは、場合によっては2行を返します。今私は1行以上を取得し、total_feesフィールドの最初の行の値を取っているケースでは、paid_amount値を追加する必要があります。
だろう
あなたはおそらく、テーブル構造、サンプルデータ、予想される出力、あなたがこれまで何をしているを共有する必要があり、どのようなあなたが得た結果は、それが何をする必要があります – Hatik