From Rude Madrill, 2 Months ago, written in Plain Text, viewed 45 times.
URL http://codebin.org/view/78bb4e3f Embed
Download Paste or View Raw
  1. WITH
  2. c AS (SELECT id, name
  3.       FROM company
  4.       WHERE milestones > 6),
  5. fr AS (SELECT id, raised_amount
  6.       FROM funding_round
  7.       WHERE EXTRACT(YEAR FROM CAST(funded_at AS timestamp)) BETWEEN 2012 AND 2013)
  8. SELECT f.name AS name_of_fund,
  9.        c.name AS name_of_company,
  10.        fr.raised_amount AS amount
  11. FROM investment AS i
  12. INNER JOIN fund AS f ON f.id=i.fund_id
  13. INNER JOIN c ON c.id=i.company_id
  14. INNER JOIN fr ON fr.id=i.funding_round_id;

Reply to "Untitled"

Here you can reply to the paste above