Find NOT NULLs in a group of 20 columns

From: gvim <gvimrc(at)gmail(dot)com>
To: pgsql sql <pgsql-sql(at)postgresql(dot)org>
Subject: Find NOT NULLs in a group of 20 columns
Date: 2011-01-11 02:14:12
Message-ID: 4D2BBCF4.8070905@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm struggling to find anything other than a complex stored proc to do this:

Out of a group of 20 columns return the rows in which:

1. Only 1 of the 20 columns IS NOT NULL
2. More than 1 of the 20 columns IS NOT NULL

Any ideas?

gvim

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2011-01-11 02:45:50 Re: Find NOT NULLs in a group of 20 columns
Previous Message Jasen Betts 2011-01-08 10:22:23 Re: pattern matching with dates?