QUERY PLAN
Aggregate (cost=96.30..96.31 rows=1 width=8)
-> Append (cost=0.00..96.25 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..68.80 rows=1 width=125)
Filter: ((erp_un_settle_amount > '0'::numeric) AND (client_id = 3286))
-> Seq Scan on tbl_erp_other_income_tickets (cost=0.00..14.01 rows=1 width=246)
Filter: ((status = 2) AND (client_id = 3286) AND ((amount - settle_amount) > '0'::numeric))
-> Seq Scan on tbl_erp_other_collect_tickets (cost=0.00..13.41 rows=1 width=246)
Filter: ((status = 2) AND (client_id = 3286) AND ((amount - settle_amount) > '0'::numeric))