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-durgapur`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-durgapur`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`))),0) AS `bal`,`lc`.`sub_head` AS `sub_head`,(select count(0) from `co-operativebank-durgapur`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-durgapur`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`) AS `total_p` from (`co-operativebank-durgapur`.`voucher` `v` join `co-operativebank-durgapur`.`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=b7de340c1a63f9812f527ddbbe08b6f5
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=1
with_check_option=0
timestamp=2022-04-04 10:27:09
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-durgapur`.`loan_acc`  where (  `lc`.`acc_no`  =  `co-operativebank-durgapur`.`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-durgapur`.`loan_acc`  where (  `lc`.`acc_no`  =  `co-operativebank-durgapur`.`loan_acc`.`acc_no`  ) group  by  `lc`.`acc_no`  ) AS  `total_p`  from (  `co-operativebank-durgapur`.`voucher`  `v`  join  `co-operativebank-durgapur`.`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-durgapur`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-durgapur`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`))),0) AS `bal`,`lc`.`sub_head` AS `sub_head`,(select count(0) from `co-operativebank-durgapur`.`loan_acc` where (`lc`.`acc_no` = `co-operativebank-durgapur`.`loan_acc`.`acc_no`) group by `lc`.`acc_no`) AS `total_p` from (`co-operativebank-durgapur`.`voucher` `v` join `co-operativebank-durgapur`.`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`
