Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. SELECT co.ein,
  2. company_name as Company,
  3. CONCAT(fo.first_name,' ',fo.last_name) as Founder,
  4. CONCAT(ceo.first_name,' ',ceo.last_name) as CEO,
  5. CASE
  6. WHEN last_price IS NULL THEN '-'
  7. ELSE CONCAT('$',FORMAT(last_price,2))
  8. END as 'Current Stock Price'
  9. FROM company co
  10. LEFT JOIN stock s ON co.ein = s.ein
  11. LEFT JOIN ceo ON co.ein = ceo.ein
  12. LEFT JOIN founder fo ON co.ein = fo.ein
  13. LEFT JOIN person p ON ceo.pid = p.pid
  14. LEFT JOIN person ON fo.pid = p.pid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement