Advertisement
abrar1

Untitled

Dec 11th, 2020
259
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT PS.NAME, COUNT(*) AS "UNITS SOLD", PS.BUYING_PRICE, PS.PRICE, COUNT(*)*(PS.BUYING_PRICE - PS.PRICE) AS PROFIT
  2. FROM SALES S, STOCK STK, PRODUCT_SPECIFICATION PS
  3. WHERE S.PRODUCT_IMEI_NO = STK.STOCK_IMEI AND STK.STOCK_PRODUCT_ID = PS.PRODUCT_ID
  4. AND S.EMPLOYEE_ID = 10
  5. GROUP BY PS.NAME, PS.BUYING_PRICE, PS.PRICE
  6. ;
Advertisement
RAW Paste Data Copied
Advertisement