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

From Richard Huxton
Subject Re: Alias "all fields"?
Date
Msg-id 46DFF12F.9020907@archonet.com
Whole thread Raw
In response to Alias "all fields"?  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Responses ANY (was: Re: Alias "all fields"?)
List pgsql-general
Stefan Schwarzer wrote:
>        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

Well you can get closer:

SELECT * FROM gdp WHERE (y1970+y1971+...+y2005) IS NOT NULL;

This makes use of the fact that X+NULL = NULL

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Need suggestion on how best to update 3 million rows
Next
From: Tino Wildenhain
Date:
Subject: Re: Alias "all fields"?