Alias "all fields"?

From: Franz(dot)Rasper(at)izb(dot)de
To: stefan(dot)schwarzer(at)grid(dot)unep(dot)ch, pgsql-general(at)postgresql(dot)org
Subject: Alias "all fields"?
Date: 2007-09-06 11:51:58
Message-ID: 11EC9A592C31034C88965C87AF18C2A702B83681@m0000s61
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hmm

> SELECT * FROM gdp WHERE y1970 NOT NULL AND y1971 NOT NULL
> AND .... y2005 NOT NULL

It sounds like a bad table design,
because i think you need an field "f_year" and "value_of_f_year" then
there would be entries like
f_year;value_of_f_year
1970 'NULL'
1970 dfgsd
1971 'NULL'
1971 ....

where f_year IS NOT NULL and value_of_f_year IS NOT NULL

Greetings,

-Franz

-----Ursprüngliche Nachricht-----
Von: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] Im Auftrag von Stefan Schwarzer
Gesendet: Donnerstag, 6. September 2007 13:43
An: pgsql-general(at)postgresql(dot)org
Betreff: [SPAM] [GENERAL] Alias "all fields"?

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...

Thanks for any advice.

Stef

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Schwarzer 2007-09-06 12:13:46 Re: Alias "all fields"?
Previous Message Stefan Schwarzer 2007-09-06 11:43:25 Alias "all fields"?