From: | Tino Wildenhain <tino(at)wildenhain(dot)de> |
---|---|
To: | Stefan Schwarzer <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Alias "all fields"? |
Date: | 2007-09-06 12:46:04 |
Message-ID: | 46DFF68C.1060003@wildenhain.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Stefan Schwarzer schrieb:
> Hi there,
>
> I guess I am demanding too much.... But it would be cool to have some
> kind of alias for "all fields".
>
> What I mean is this here:
>
> Instead of this:
>
> SELECT * FROM gdp WHERE y1970 NOT NULL AND y1971 NOT NULL AND
> .... y2005 NOT NULL
>
> I would like to have this:
>
> SELECT * FROM gdp WHERE all-fields NOT NULL
>
> This is, because my tables have different - and a different number of
> fields.
>
> In principal, I actually just want to have the number of fields which
> are NOT NULL...
Well, this seems more a matter of correct normalization.
If you organize your tables to have a column for the year,
you would just not have "empty" years to select. Problem solved.
Last not least you can easily count the existing years and
whatnot...
Regards
Tino
From | Date | Subject | |
---|---|---|---|
Next Message | Franz.Rasper | 2007-09-06 12:46:26 | Re: Alias "all fields"? |
Previous Message | Richard Huxton | 2007-09-06 12:23:11 | Re: Alias "all fields"? |