TYPE=VIEW
query=select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank`.`voucher` `v` where (((`v`.`head` = \'14100\') or (`v`.`head` = \'14200\') or (`v`.`head` = \'14300\')) and (`v`.`date` <= \'2023-09-22\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`dr`) - sum(`v`.`cr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank`.`voucher` `v` where (((`v`.`head` = \'23300\') or (`v`.`head` = \'23400\') or (`v`.`head` = \'23100\') or (`v`.`head` = \'23200\')) and (`v`.`date` <= \'2023-09-22\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank`.`voucher` `v` where (((`v`.`head` = \'11100\') or (`v`.`head` = \'11200\')) and (`v`.`date` <= \'2023-09-22\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no`
md5=be04c07e085859777eb085db4eac3fdc
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2023-09-22 06:17:09
create-version=1
source=select max(v.date) as date,v.acc_no,if(sum(cr)-sum(dr)>0,\'Active\',\'Close\') as Status from voucher v where  (head=\'14100\' or head=\'14200\' or head=\'14300\')  and date<=\'2023-09-22\' and (cr>0 or dr>0)  group by v.acc_no union all select max(v.date) as date,v.acc_no,if(sum(dr)-sum(cr)>0,\'Active\',\'Close\') as Status from voucher v where  (head=\'23300\' or head=\'23400\' or head=\'23100\' or head=\'23200\')  and date<=\'2023-09-22\' and (cr>0 or dr>0)  group by v.acc_no union all select max(v.date) as date,v.acc_no,if(sum(cr)-sum(dr)>0,\'Active\',\'Close\') as Status from voucher v where  (head=\'11100\' or head=\'11200\')  and date<=\'2023-09-22\' and (cr>0 or dr>0) group by v.acc_no
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank`.`voucher` `v` where (((`v`.`head` = \'14100\') or (`v`.`head` = \'14200\') or (`v`.`head` = \'14300\')) and (`v`.`date` <= \'2023-09-22\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`dr`) - sum(`v`.`cr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank`.`voucher` `v` where (((`v`.`head` = \'23300\') or (`v`.`head` = \'23400\') or (`v`.`head` = \'23100\') or (`v`.`head` = \'23200\')) and (`v`.`date` <= \'2023-09-22\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank`.`voucher` `v` where (((`v`.`head` = \'11100\') or (`v`.`head` = \'11200\')) and (`v`.`date` <= \'2023-09-22\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no`
