1
Hello,
I have a global HDI table and would like to consult the 10 countries with the highest HDI and to include Brazil (which is not among the 10 largest ones) in this consultation. As a result, there would be 11 countries. How can I do this query? It is possible to add the ranking position (for example: 1, Niger; 2, Central African Republic; 3, Eritrea...)
My initial consultation is as follows (not including Brazil):
SELECT pais, ano, valor
FROM idh
ORDER BY valor
LIMIT 10;
Utilizo Postgresql 13.1.
There is question of this already on the site, I will see if I locate the link. just do
order by pais != "Brasil", valor
or a 2 selects UNION, one with WHERE pais="BRASIL" and the other with the current query (picking 9, for example)– Bacco
I didn’t remember to use the UNION and it worked right. Thank you.
– Raffa Bass