Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH
- t_companies AS (
- SELECT id
- , name AS name_of_company
- FROM company
- WHERE funding_rounds > 6
- ),
- t_funding_rounds AS (
- SELECT id
- , raised_amount AS amount
- FROM funding_round
- WHERE EXTRACT(YEAR FROM CAST(funded_at AS date)) BETWEEN 2012 AND 2013
- )
- SELECT f.name AS name_of_fund
- , c.name_of_company
- , fr.amount
- FROM investment AS inv
- INNER JOIN t_companies AS c ON inv.company_id=c.id
- INNER JOIN fund AS f ON inv.fund_id=f.id
- INNER JOIN t_funding_rounds AS fr ON inv.funding_round_id=fr.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement