Tables:
Purchase Order( order_id, product_id, quantity, Status)
Product(product_id, name)
The report we want is this:
select name,
(select qty from PurchaseOrder where product_id =a.product_id and order_id='AA001'),
(select qty from PurchaseOrder where product_id =a.product_id and order_id='AA002'),
(select qty from PurchaseOrder where product_id =a.product_id and order_id='AA003'),
(select sum(qty) from PurchaseOrder where product_id in ['AA001','AA002','AA003') as total
from product a
It should display a table of products, with the columns for each purchase order.
And it is better the font color is rendered according to the status (received, pending) of the order.
Thank you very much.
Purchase Order( order_id, product_id, quantity, Status)
Product(product_id, name)
The report we want is this:
select name,
(select qty from PurchaseOrder where product_id =a.product_id and order_id='AA001'),
(select qty from PurchaseOrder where product_id =a.product_id and order_id='AA002'),
(select qty from PurchaseOrder where product_id =a.product_id and order_id='AA003'),
(select sum(qty) from PurchaseOrder where product_id in ['AA001','AA002','AA003') as total
from product a
It should display a table of products, with the columns for each purchase order.
And it is better the font color is rendered according to the status (received, pending) of the order.
Thank you very much.