Advertisement
abrar1

Untitled

Dec 10th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. select sl.EMPLOYEE_ID,(select e.NAME from EMPLOYEES e where e.EMPLOYEE_ID = sl.EMPLOYEE_ID ) as Name, SUM(sp.PRICE - nvl(sp.BUYING_PRICE,0)) as Profit
  2. from SALES sl, STOCK stk, PRODUCT_SPECIFICATION sp
  3. where sl.PRODUCT_IMEI_NO = stk.STOCK_IMEI and stk.STOCK_PRODUCT_ID = sp.PRODUCT_ID
  4. group by sl.EMPLOYEE_ID
  5. order by sl.EMPLOYEE_ID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement