-
-
Save BhargaviTelpunuri/9efd8124337fd141fb415eca3fc5f00a to your computer and use it in GitHub Desktop.
p
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from (SELECT 'FPS' Level ,sh.SHOP_NO Geography | |
,CASE | |
WHEN st.PRODUCT_ID = 1 | |
THEN sum(qty) | |
ELSE 0 | |
END Rice_PH | |
,CASE | |
WHEN st.PRODUCT_ID = 2 | |
THEN sum(qty) | |
ELSE 0 | |
END Wheat | |
,CASE | |
WHEN st.PRODUCT_ID = 4 | |
THEN sum(qty) | |
ELSE 0 | |
END Rice_A | |
FROM STOCK_HEADER_P sh | |
,STOCK_TRAILER_P st | |
WHERE sh.DN_SEQ_NO = st.DN_SEQ_NO group by sh.shop_no,st.PRODUCT_ID ) a,STOCK_INVENTORY_P si where a.Geography=si.SHOP_NO | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment