QUERY PLAN
Aggregate (cost=87.96..87.97 rows=1 width=8)
-> Append (cost=0.00..87.91 rows=4 width=196)
-> Subquery Scan on "*SELECT* 1" (cost=0.00..0.00 rows=1 width=438)
-> Result (cost=0.00..0.00 rows=0 width=436)
One-Time Filter: false
-> Seq Scan on tbl_sales_contracts (cost=0.00..81.32 rows=1 width=154)
Filter: ((client_id = 3286) AND ((amount - erp_all_settle_amount) > '0'::numeric))
-> Seq Scan on tbl_erp_other_income_tickets (cost=0.00..3.61 rows=1 width=161)
Filter: ((status = 2) AND (client_id = 3286) AND ((amount - all_settle_amount) > '0'::numeric))
-> Seq Scan on tbl_erp_other_collect_tickets (cost=0.00..2.95 rows=1 width=170)
Filter: ((bank_settle_at IS NOT NULL) AND (status = 2) AND (client_id = 3286) AND ((amount - all_settle_amount) > '0'::numeric))