TYPE=VIEW
query=select `v`.`Acc_no` AS `sv_acc`,`lc`.`acc_no` AS `loan_acc`,round(if((`lc`.`poloan` = \'\'),(sum(`v`.`cr`) - sum(`v`.`dr`)),((sum(`v`.`cr`) - sum(`v`.`dr`)) / (select count(0) from `co-operativebank-244`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-244`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`))),0) AS `bal`,`lc`.`sub_head` AS `sub_head`,(select count(0) from `co-operativebank-244`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-244`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`) AS `total_p` from (`co-operativebank-244`.`voucher` `v` join `co-operativebank-244`.`loan_acc` `lc`) where ((`lc`.`loan_against_sv_acc` = `v`.`Acc_no`) and (`lc`.`sub_head` = \'23113\') and (`v`.`sub_head` = \'14201\') and (`v`.`date` <= \'2021-03-31\')) group by `lc`.`acc_no` order by `lc`.`date_open`
md5=9a9a9f93b0b85e32615280dfcd22f4fb
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=1
with_check_option=0
timestamp=2025-11-19 04:30:20
create-version=1
source=select  `v`.`Acc_no`  AS  `sv_acc` ,\n `lc`.`acc_no`  AS  `loan_acc` ,\nround( if( (  `lc`.`poloan`  =  \'\' ), ( sum(  `v`.`cr`  )  - sum(  `v`.`dr`  )  ) , ( ( sum(  `v`.`cr`  )  - sum(  `v`.`dr`  )  )  / (  select count( 0  )  from  `co-operativebank-244`.`loan_acc`  where (  `lc`.`acc_no`  =  `co-operativebank-244`.`loan_acc`.`acc_no`  ) group  by  `lc`.`acc_no`  )  ) ),\n0 ) AS  `bal` ,\n `lc`.`sub_head`  AS  `sub_head` ,\n(  select count( 0  )  from  `co-operativebank-244`.`loan_acc`  where (  `lc`.`acc_no`  =  `co-operativebank-244`.`loan_acc`.`acc_no`  ) group  by  `lc`.`acc_no`  ) AS  `total_p`  from (  `co-operativebank-244`.`voucher`  `v`  join  `co-operativebank-244`.`loan_acc`  `lc`  ) where ( (  `lc`.`loan_against_sv_acc`  =  `v`.`Acc_no`  ) and (  `lc`.`sub_head`  =  \'23113\' ) and (  `v`.`sub_head`  =  \'14201\' ) and (  `v`.`date`  <=  \'2021-03-31\' ) ) group  by  `lc`.`acc_no`  order  by  `lc`.`date_open`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `v`.`Acc_no` AS `sv_acc`,`lc`.`acc_no` AS `loan_acc`,round(if((`lc`.`poloan` = \'\'),(sum(`v`.`cr`) - sum(`v`.`dr`)),((sum(`v`.`cr`) - sum(`v`.`dr`)) / (select count(0) from `co-operativebank-244`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-244`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`))),0) AS `bal`,`lc`.`sub_head` AS `sub_head`,(select count(0) from `co-operativebank-244`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-244`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`) AS `total_p` from (`co-operativebank-244`.`voucher` `v` join `co-operativebank-244`.`loan_acc` `lc`) where ((`lc`.`loan_against_sv_acc` = `v`.`Acc_no`) and (`lc`.`sub_head` = \'23113\') and (`v`.`sub_head` = \'14201\') and (`v`.`date` <= \'2021-03-31\')) group by `lc`.`acc_no` order by `lc`.`date_open`
