QUERY PLAN
Aggregate (cost=11.63..11.64 rows=1 width=8)
-> Sort (cost=11.61..11.62 rows=1 width=304)
Sort Key: r.id DESC
-> Seq Scan on tbl_erp_purchase_order_products r (cost=0.00..11.60 rows=1 width=304)
Filter: ((number <> into_inventory) AND (erp_purchase_order_id = 2223))