TYPE=VIEW
query=select `co-operativebank`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank`.`head`.`code` AS `code`,`co-operativebank`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank`.`voucher`.`dr`) - sum(`co-operativebank`.`voucher`.`cr`)) AS `bal` from `co-operativebank`.`voucher` join `co-operativebank`.`sub_head` join `co-operativebank`.`head` join `co-operativebank`.`head_type` where ((`co-operativebank`.`voucher`.`sub_head` = `co-operativebank`.`sub_head`.`code`) and (`co-operativebank`.`sub_head`.`head` = `co-operativebank`.`head`.`code`) and (`co-operativebank`.`head`.`head_type` = `co-operativebank`.`head_type`.`code`) and (((`co-operativebank`.`voucher`.`sub_head` > \'60000\') and (`co-operativebank`.`voucher`.`sub_head` < \'70000\')) or (`co-operativebank`.`head_type`.`code` = \'23000\') or (`co-operativebank`.`head_type`.`code` = \'21000\')) and (`co-operativebank`.`voucher`.`date` < \'2016-04-01\')) group by `co-operativebank`.`voucher`.`sub_head` union all select `co-operativebank`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank`.`head`.`code` AS `code`,`co-operativebank`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank`.`voucher`.`cr`) - sum(`co-operativebank`.`voucher`.`dr`)) AS `(sum(cr)-sum(dr))` from `co-operativebank`.`voucher` join `co-operativebank`.`sub_head` join `co-operativebank`.`head` join `co-operativebank`.`head_type` where ((`co-operativebank`.`voucher`.`sub_head` = `co-operativebank`.`sub_head`.`code`) and (`co-operativebank`.`sub_head`.`head` = `co-operativebank`.`head`.`code`) and (`co-operativebank`.`head`.`head_type` = `co-operativebank`.`head_type`.`code`) and (`co-operativebank`.`voucher`.`date` < \'2016-04-01\') and ((`co-operativebank`.`head_type`.`code` = \'22000\') or (`co-operativebank`.`head_type`.`code` = \'28000\'))) group by `co-operativebank`.`voucher`.`sub_head`
md5=481853cbb864c9461ae1d80116982929
updatable=0
algorithm=0
definer_user=admin
definer_host=%
suid=2
with_check_option=0
timestamp=2017-06-09 05:12:54
create-version=1
source=select `voucher`.`sub_head` AS `sub_head`,head.code,head_type.code head_type,(sum(`voucher`.`dr`) - sum(`voucher`.`cr`)) AS `bal` from `voucher`,sub_head,head,head_type where voucher.sub_head=sub_head.code and sub_head.head=head.code and head.head_type=head_type.code and ((voucher.sub_head>\'60000\' and voucher.sub_head<\'70000\') or ( head_type.code=\'23000\' or head_type.code=\'21000\')) and date<\'2016-04-01\' group by `voucher`.`sub_head` union ALL  select voucher.sub_head,head.code,head_type.code head_type,(sum(cr)-sum(dr)) from voucher ,sub_head,head,head_type where voucher.sub_head=sub_head.code and sub_head.head=head.code and head.head_type=head_type.code and date<\'2016-04-01\' and ( head_type.code=\'22000\' or head_type.code=\'28000\') group by voucher.sub_head
client_cs_name=latin1
connection_cl_name=latin1_swedish_ci
view_body_utf8=select `co-operativebank`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank`.`head`.`code` AS `code`,`co-operativebank`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank`.`voucher`.`dr`) - sum(`co-operativebank`.`voucher`.`cr`)) AS `bal` from `co-operativebank`.`voucher` join `co-operativebank`.`sub_head` join `co-operativebank`.`head` join `co-operativebank`.`head_type` where ((`co-operativebank`.`voucher`.`sub_head` = `co-operativebank`.`sub_head`.`code`) and (`co-operativebank`.`sub_head`.`head` = `co-operativebank`.`head`.`code`) and (`co-operativebank`.`head`.`head_type` = `co-operativebank`.`head_type`.`code`) and (((`co-operativebank`.`voucher`.`sub_head` > \'60000\') and (`co-operativebank`.`voucher`.`sub_head` < \'70000\')) or (`co-operativebank`.`head_type`.`code` = \'23000\') or (`co-operativebank`.`head_type`.`code` = \'21000\')) and (`co-operativebank`.`voucher`.`date` < \'2016-04-01\')) group by `co-operativebank`.`voucher`.`sub_head` union all select `co-operativebank`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank`.`head`.`code` AS `code`,`co-operativebank`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank`.`voucher`.`cr`) - sum(`co-operativebank`.`voucher`.`dr`)) AS `(sum(cr)-sum(dr))` from `co-operativebank`.`voucher` join `co-operativebank`.`sub_head` join `co-operativebank`.`head` join `co-operativebank`.`head_type` where ((`co-operativebank`.`voucher`.`sub_head` = `co-operativebank`.`sub_head`.`code`) and (`co-operativebank`.`sub_head`.`head` = `co-operativebank`.`head`.`code`) and (`co-operativebank`.`head`.`head_type` = `co-operativebank`.`head_type`.`code`) and (`co-operativebank`.`voucher`.`date` < \'2016-04-01\') and ((`co-operativebank`.`head_type`.`code` = \'22000\') or (`co-operativebank`.`head_type`.`code` = \'28000\'))) group by `co-operativebank`.`voucher`.`sub_head`
