Skip to content
Rafael Polo edited this page Jul 8, 2017 · 3 revisions

Exemplos de inquéritos básicos


  • 6 partidos mais financiados.
sql>  select partido, sum(valor) as total 
      from doacoes 
      group by partido 
      order by total DESC  
      limit 6;                                                                           
       
+---------+---------------+
| partido | total         |
+---------+---------------+
| PSDB    | 4935608283.20 |
| PT      | 4667035211.17 |
| PMDB    | 4515359963.19 |
| PSB     | 1916153158.60 |
| PP      | 1412750919.22 |
| DEM     | 1272346716.31 |
| PDT     | 1238987643.88 |
+---------+---------------+

Clone this wiki locally