Genial!

Com 'DISTINCT ON (iso3166_2)' devolve apenas um registo por pais
e com 'ORDER BY iso3166_2,  area DESC ' devolve apenas a área de maior
valor.

Muito bem. Muito obrigado, solucionado!


Eloi Ribeiro
GIS Analyst
39,45º -4,40º
http://eloiribeiro.wordpress.com

On Wed, Nov 3, 2010 at 13:08, Fabrízio de Royes Mello <
[email protected]> wrote:

>
>
> 2010/11/3 Eloi Ribeiro <[email protected]>
>
>>
>> <corte>
>>
>> SELECT * FROM vw_globalfires_country_biome_max02;
>> "AD";"Temperate Broadleaf and Mixed Forests";0.0520229
>> "AE";"Deserts and Xeric Shrublands";6.20797
>> "AF";"Deserts and Xeric Shrublands";49.9593
>> "AG";"Deserts and Xeric Shrublands";0.0279382
>> (...)
>>
>>
>>
> Veja se resolve:
>
> SELECT DISTINCT ON (iso3166_2)
>        iso3166_2,
>        biome,
>        area
>   FROM vw_globalfires_country_biome
>  ORDER BY iso3166_2,
>           area DESC ;
>
> --
> Fabrízio de Royes Mello
> >> Blog sobre TI: http://fabriziomello.blogspot.com
> >> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>
>
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
>
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a