Calculate the ratio

Поиск
Список
Период
Сортировка
От Andreas Forø Tollefsen
Тема Calculate the ratio
Дата
Msg-id CAGMz7DnkL2=VxpYqEsqTnMS=MTyDywgu_Z+b79X9ugqn5BgHpg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Calculate the ratio  (msi77 <msi77@yandex.ru>)
Re: Calculate the ratio  ("David Johnston" <polobo@yahoo.com>)
Список pgsql-sql
Hi all,

This is probably quite simple. I want to calculate the ratio of each country (gwcode) which experiences a 1 in one column (cf).

Structure:

gid; gridyear; gwcode; area; cf

I want to select the SUM(area) WHERE cf = 1 into one column, and SUM(area) WHERE cf = 0 into another column and group by gridyear and gwcode.
Then i can see the ratio of the area of each country affected by cf.

Any suggestions?

Thanks.

A.


В списке pgsql-sql по дате отправления:

Предыдущее
От: David Harel
Дата:
Сообщение: Re: pgadmin debugger
Следующее
От: msi77
Дата:
Сообщение: Re: Calculate the ratio