TYPE=VIEW
query=select `v`.`date` AS `date`,`b`.`code` AS `acc_no`,`b`.`sub_head` AS `b_sub_head`,0 AS `cr`,0 AS `dr`,`b`.`loan_sub_head` AS `p_sub_head`,if(((`b`.`loan_sub_head` = \'23101A\') or (`b`.`loan_sub_head` = \'23101B\')),23100,\'\') AS `marge_teble`,sum(`v`.`cr`) AS `bcr`,sum(`v`.`dr`) AS `bdr` from (`co-operativebank-234`.`borrowing` `b` join `co-operativebank-234`.`voucher` `v`) where ((`v`.`sub_head` = `b`.`sub_head`) and (`v`.`Acc_no` = `b`.`code`)) group by `v`.`date`,`b`.`sub_head`,`b`.`date` union all select `v`.`date` AS `date`,`v`.`Acc_no` AS `acc_no`,`v`.`sub_head` AS `b_sub_head`,sum(`v`.`dr`) AS `cr`,sum(`v`.`cr`) AS `dr`,`v`.`sub_head` AS `p_sub_head`,if(((`v`.`sub_head` = \'23101A\') or (`v`.`sub_head` = \'23101B\')),23100,\'\') AS `marge_teble`,0 AS `cr`,0 AS `dr` from `co-operativebank-234`.`voucher` `v` where ((`v`.`date` <= \'2022-04-30\') and ((`v`.`head` = \'23100\') or (`v`.`head` = \'23200\') or (`v`.`head` = \'23300\') or (`v`.`head` = \'23400\') or ((`v`.`head` = \'23500\') and (`v`.`head` = \'23600\')))) group by `v`.`Acc_no`
md5=8956b0fb58845a7522de18b1458f4fd5
updatable=0
algorithm=0
definer_user=root
definer_host=localhost
suid=1
with_check_option=0
timestamp=2024-08-01 11:04:27
create-version=1
source=select  `v`.`date`  AS  `date` ,\n `b`.`code`  AS  `acc_no` ,\n `b`.`sub_head`  AS  `b_sub_head` ,\n0 AS  `cr` ,\n0 AS  `dr` ,\n `b`.`loan_sub_head`  AS  `p_sub_head` ,\nif( ( (  `b`.`loan_sub_head`  =  \'23101A\' ) or (  `b`.`loan_sub_head`  =  \'23101B\' ) ) ,\n23100,\n \'\' ) AS  `marge_teble` ,\nsum(  `v`.`cr`  )  AS  `bcr` ,\nsum(  `v`.`dr`  )  AS  `bdr`  from (  `co-operativebank-234`.`borrowing`  `b`  join  `co-operativebank-234`.`voucher`  `v`  ) where ( (  `v`.`sub_head`  =  `b`.`sub_head`  ) and (  `v`.`Acc_no`  =  `b`.`code`  ) ) group  by  `v`.`date` ,\n `b`.`sub_head` ,\n `b`.`date`  union  all  select  `v`.`date`  AS  `date` ,\n `v`.`Acc_no`  AS  `acc_no` ,\n `v`.`sub_head`  AS  `b_sub_head` ,\nsum(  `v`.`dr`  )  AS  `cr` ,\nsum(  `v`.`cr`  )  AS  `dr` ,\n `v`.`sub_head`  AS  `p_sub_head` ,\nif( ( (  `v`.`sub_head`  =  \'23101A\' ) or (  `v`.`sub_head`  =  \'23101B\' ) ) ,\n23100,\n \'\' ) AS  `marge_teble` ,\n0 AS  `cr` ,\n0 AS  `dr`  from  `co-operativebank-234`.`voucher`  `v`  where ( (  `v`.`date`  <=  \'2022-04-30\' ) and ( (  `v`.`head`  =  \'23100\' ) or (  `v`.`head`  =  \'23200\' ) or (  `v`.`head`  =  \'23300\' ) or (  `v`.`head`  =  \'23400\' ) or ( (  `v`.`head`  =  \'23500\' ) and (  `v`.`head`  =  \'23600\' ) ) ) ) group  by  `v`.`Acc_no`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `v`.`date` AS `date`,`b`.`code` AS `acc_no`,`b`.`sub_head` AS `b_sub_head`,0 AS `cr`,0 AS `dr`,`b`.`loan_sub_head` AS `p_sub_head`,if(((`b`.`loan_sub_head` = \'23101A\') or (`b`.`loan_sub_head` = \'23101B\')),23100,\'\') AS `marge_teble`,sum(`v`.`cr`) AS `bcr`,sum(`v`.`dr`) AS `bdr` from (`co-operativebank-234`.`borrowing` `b` join `co-operativebank-234`.`voucher` `v`) where ((`v`.`sub_head` = `b`.`sub_head`) and (`v`.`Acc_no` = `b`.`code`)) group by `v`.`date`,`b`.`sub_head`,`b`.`date` union all select `v`.`date` AS `date`,`v`.`Acc_no` AS `acc_no`,`v`.`sub_head` AS `b_sub_head`,sum(`v`.`dr`) AS `cr`,sum(`v`.`cr`) AS `dr`,`v`.`sub_head` AS `p_sub_head`,if(((`v`.`sub_head` = \'23101A\') or (`v`.`sub_head` = \'23101B\')),23100,\'\') AS `marge_teble`,0 AS `cr`,0 AS `dr` from `co-operativebank-234`.`voucher` `v` where ((`v`.`date` <= \'2022-04-30\') and ((`v`.`head` = \'23100\') or (`v`.`head` = \'23200\') or (`v`.`head` = \'23300\') or (`v`.`head` = \'23400\') or ((`v`.`head` = \'23500\') and (`v`.`head` = \'23600\')))) group by `v`.`Acc_no`
