Advertisement
congky

Get product with stock < 0

Dec 18th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT f_get_warehouse_code(A.warehouse_id) AS warehouse_code,
  2.     f_get_warehouse_name(A.warehouse_id) AS warehouse_name,
  3.     f_get_product_code(A.product_id) AS product_code,
  4.     f_get_product_name(A.product_id) AS product_name,
  5.     A.product_status, SUM(A.qty) AS qty
  6. FROM in_product_balance_stock A
  7. GROUP BY A.warehouse_id, A.product_id, A.product_status
  8. HAVING SUM(A.qty) < 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement