Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. sum(earnings) when title = 'Novice' as Novice_Earnings;
  2. sum(earnings) when title = 'Journeyman' as Journeyman_Earnings;
  3. sum(earnings) when title = 'Master' as Master_Earnings;
  4.  
  5. SELECT title, sum(earnings) as earnings
  6. FROM business_ledger
  7. GROUP BY title
  8.  
  9. SELECT
  10. title, certification, earnings
  11. FROM business_ledger
  12. WHERE certification in
  13. (SELECT certification
  14. FROM business_ledger
  15. )
  16. GROUP BY title, certification
  17. ORDER BY title, certification
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement