Re: Alias "all fields"? - Mailing list pgsql-general

From Franz.Rasper@izb.de
Subject Re: Alias "all fields"?
Date
Msg-id 11EC9A592C31034C88965C87AF18C2A702B83682@m0000s61
Whole thread Raw
In response to Alias "all fields"?  (Franz.Rasper@izb.de)
List pgsql-general
>My table design is - due to some import/update reasons - surely not
>the best one, but pretty simple:
>
>id    y1970    y1971    y1972 ......
>1       23           25           28
>2     NULL    NULL         5
>3     NULL      94          102
>
>What do you think?

Normally i use perl with DBD/DBI to import data into databases and it is
quite
easy to modify raw data with perl and import them.

I would prefer another table design (your import will then not be so simple,
but your "selects" will get "normally" faster and easier).

Table:
id_Table;id_row;t_year;t_year_value
1;1;y1970,23
2;1;y1971;25
...
....
20;3;y1970;NULL
21;3;y1971;94

You will need only id_row if you need all tuples in the same line of your
original line.

I yould do it so, if you have more then 3 or 4 columns of y???? .

Greetings,

-Franz







pgsql-general by date:

Previous
From: Tino Wildenhain
Date:
Subject: Re: Alias "all fields"?
Next
From: Paul Tilles
Date:
Subject: Version 8.2.4 ecpg - function not found