TYPE=VIEW
query=select if(((sum(`h1`.`cr`) - sum(`h1`.`dr`)) > -(100000)),(sum(`h1`.`cr`) - sum(`h1`.`dr`)),0) AS `br`,if(((select if((sum(`h2`.`cr`) > 0),sum(`h2`.`cr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`hcode` = `h1`.`hcode`) and (`h2`.`htcode` = \'15000\') and ((`h2`.`date` >= \' 2025-04-01\') + interval -(1) year) and ((`h2`.`date` <= \' 2026-03-31 \') + interval -(1) year)) group by `h2`.`hcode`) > 0),(select if((sum(`h2`.`cr`) > 0),sum(`h2`.`cr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`hcode` = `h1`.`hcode`) and (`h2`.`htcode` = \'15000\') and ((`h2`.`date` >= \' 2025-04-01 \') + interval -(1) year) and ((`h2`.`date` <= \' 2026-03-31 \') + interval -(1) year)) group by `h2`.`hcode`),0) AS `br1`,(`h1`.`hcode` + 46000) AS `hcode`,`h1`.`head` AS `head` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h1` where ((`h1`.`htcode` = \'15000\') and (`h1`.`date` <= \' 2024-03-31 \')) group by `h1`.`hcode`
md5=ea5cd7e2940f967f88dc0c0e7ea346cb
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2026-04-01 12:39:49
create-version=1
source=select if(((sum(`h1`.`cr`) - sum(`h1`.`dr`)) > -(100000)),(sum(`h1`.`cr`) - sum(`h1`.`dr`)),0) AS `br`,if(((select if(((sum(`h2`.`cr`) ) > 0),(sum(`h2`.`cr`) ),0) AS `ln1` from `headvoucher` `h2` where ((`h2`.`hcode` = `h1`.`hcode`) and (`h2`.`htcode` = \'15000\') and date_add((`h2`.`date` >= \' 2025-04-01\'), interval -1 year) and date_add((`h2`.`date` <= \' 2026-03-31 \'), interval -1 year)) group by `h2`.`hcode`) > 0),(select if(((sum(`h2`.`cr`) ) > 0),(sum(`h2`.`cr`) ),0) AS `ln1` from `headvoucher` `h2` where ((`h2`.`hcode` = `h1`.`hcode`) and (`h2`.`htcode` = \'15000\') and date_add((`h2`.`date` >= \' 2025-04-01 \'), interval -1 year) and date_add((`h2`.`date` <= \' 2026-03-31 \'), interval -1 year)) group by `h2`.`hcode`),0) AS `br1`,(`h1`.`hcode` + 46000) AS `hcode`,h1.head from `headvoucher` `h1` where ((`h1`.`htcode` = \'15000\') and (`h1`.`date` <= \' 2024-03-31 \')) group by `h1`.`hcode`
client_cs_name=utf8mb4
connection_cl_name=utf8mb4_general_ci
view_body_utf8=select if(((sum(`h1`.`cr`) - sum(`h1`.`dr`)) > -(100000)),(sum(`h1`.`cr`) - sum(`h1`.`dr`)),0) AS `br`,if(((select if((sum(`h2`.`cr`) > 0),sum(`h2`.`cr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`hcode` = `h1`.`hcode`) and (`h2`.`htcode` = \'15000\') and ((`h2`.`date` >= \' 2025-04-01\') + interval -(1) year) and ((`h2`.`date` <= \' 2026-03-31 \') + interval -(1) year)) group by `h2`.`hcode`) > 0),(select if((sum(`h2`.`cr`) > 0),sum(`h2`.`cr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`hcode` = `h1`.`hcode`) and (`h2`.`htcode` = \'15000\') and ((`h2`.`date` >= \' 2025-04-01 \') + interval -(1) year) and ((`h2`.`date` <= \' 2026-03-31 \') + interval -(1) year)) group by `h2`.`hcode`),0) AS `br1`,(`h1`.`hcode` + 46000) AS `hcode`,`h1`.`head` AS `head` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h1` where ((`h1`.`htcode` = \'15000\') and (`h1`.`date` <= \' 2024-03-31 \')) group by `h1`.`hcode`
