TYPE=VIEW
query=select `h`.`code` AS `code`,`h`.`head` AS `HEAD_TEXT`,sum(`v`.`cr`) AS `CR`,sum(`v`.`dr`) AS `DR`,(sum(`v`.`cr`) - sum(`v`.`dr`)) AS `opbal`,`v`.`head` AS `head`,`ht`.`code` AS `htcode` from `co-operativebank`.`voucher` `v` join `co-operativebank`.`head` `h` join `co-operativebank`.`head_type` `ht` where ((`ht`.`code` = `h`.`head_type`) and (`ht`.`code` <> 28000) and (`ht`.`code` <> 22000) and (`v`.`head` = `h`.`code`) and (`v`.`date` < \'2015-04-01\')) group by `ht`.`code` union all select `h`.`code` AS `code`,`h`.`head` AS `HEAD_TEXT`,sum(`v`.`dr`) AS `CR`,sum(`v`.`cr`) AS `DR`,(sum(`v`.`dr`) - sum(`v`.`cr`)) AS `opbal`,`v`.`head` AS `head`,`ht`.`code` AS `htcode` from `co-operativebank`.`voucher` `v` join `co-operativebank`.`head` `h` join `co-operativebank`.`head_type` `ht` where ((`ht`.`code` = `h`.`head_type`) and (`ht`.`code` = \'28000\') and (`ht`.`code` = \'22000\') and (`v`.`head` = `h`.`code`) and (`v`.`date` < \'2015-04-01\')) group by `ht`.`code`
md5=0b9ab1dbadba580d59b5879a1e778fb6
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2016-08-14 22:32:34
create-version=1
source=select h.code,h.head HEAD_TEXT,sum(cr) CR ,sum(dr) DR, (SUM(CR)-SUM(DR)) opbal, v.head,ht.code htcode from voucher v,head h,head_type ht where ht.code=h.head_type AND HT.CODE<>28000 AND HT.CODE<>22000 and v.head=h.code and v.date<\'2015-04-01\' group by ht.code UNION ALL select h.code,h.head HEAD_TEXT,sum(DR) CR ,sum(CR) DR,(SUM(DR)-SUM(CR)) opbal,v.head,ht.code htcode from voucher v,head h,head_type ht where ht.code=h.head_type AND HT.CODE=\'28000\' AND HT.CODE=\'22000\' and v.head=h.code and v.date<\'2015-04-01\' group by ht.code
client_cs_name=latin1
connection_cl_name=latin1_swedish_ci
view_body_utf8=select `h`.`code` AS `code`,`h`.`head` AS `HEAD_TEXT`,sum(`v`.`cr`) AS `CR`,sum(`v`.`dr`) AS `DR`,(sum(`v`.`cr`) - sum(`v`.`dr`)) AS `opbal`,`v`.`head` AS `head`,`ht`.`code` AS `htcode` from `co-operativebank`.`voucher` `v` join `co-operativebank`.`head` `h` join `co-operativebank`.`head_type` `ht` where ((`ht`.`code` = `h`.`head_type`) and (`ht`.`code` <> 28000) and (`ht`.`code` <> 22000) and (`v`.`head` = `h`.`code`) and (`v`.`date` < \'2015-04-01\')) group by `ht`.`code` union all select `h`.`code` AS `code`,`h`.`head` AS `HEAD_TEXT`,sum(`v`.`dr`) AS `CR`,sum(`v`.`cr`) AS `DR`,(sum(`v`.`dr`) - sum(`v`.`cr`)) AS `opbal`,`v`.`head` AS `head`,`ht`.`code` AS `htcode` from `co-operativebank`.`voucher` `v` join `co-operativebank`.`head` `h` join `co-operativebank`.`head_type` `ht` where ((`ht`.`code` = `h`.`head_type`) and (`ht`.`code` = \'28000\') and (`ht`.`code` = \'22000\') and (`v`.`head` = `h`.`code`) and (`v`.`date` < \'2015-04-01\')) group by `ht`.`code`
