Compare Content in Multidimensional Array [PHP/SQL]

From: Stefan Schwarzer <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch>
To: pgsql-general(at)postgresql(dot)org
Subject: Compare Content in Multidimensional Array [PHP/SQL]
Date: 2007-09-26 13:01:18
Message-ID: 7B63B740-CD82-4E86-A02D-5348676A2C9D@grid.unep.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

I have some global national statistical data sets.

The table design is like this for each variable:

name 2001 2002 2003 2004 2005
-----------------------------------------------------------------
Afghanistan ....
Albania ....

I would like to offer the possibility to compare two (or more)
variables for a given country. The data values need to be set to 100
at the first year which both variables have in common.

So, one variable could have an annual vallues between 1960 and 2005;
another one only from 1975 to 2005.

So, the values for the country would be set to 100 based on the year
1975.

In the moment I have a loop for the number of variables, selecting
all data and stocking them into an array:

$data[$number_of_dataset][$year] = $value_of_that_year;

Probably there could be better approach in finding the
"smallest_common_year"?!

If not, I wonder how, by using PHP, I can get that information...

Can anyone give me a hint?

Thank you very much!

Stef

____________________________________________________________________

Stefan Schwarzer

Lean Back and Relax - Enjoy some Nature Photography: http://
photoblog.la-famille-schwarzer.de

Or: Appetite for Global Data? UNEP GEO Data Portal: http://
geodata.grid.unep.ch
____________________________________________________________________

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2007-09-26 13:07:10 Re: subquery/alias question
Previous Message manju arumugam 2007-09-26 12:58:09 regds bulk of records