Re: select all rows where any column is NULL

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: select all rows where any column is NULL
Дата
Msg-id 00c301cc4bcc$86445ae0$92cd10a0$@yahoo.com
обсуждение исходный текст
Ответ на select all rows where any column is NULL  (Nathan Boley <npboley@gmail.com>)
Список pgsql-general
Copy and paste the column names from the "CREATE TABLE" statement...

You can try using information schema and building a dynamic SQL query inside
a function...

If you let people know WHAT you are trying to accomplish you may find you
get alternative suggestions that you never considered.

SQL itself is designed for a variable/unknown numbers of rows but a
fixed/known number of columns.  The only way around that is to use a "table
of column names" to identify the columns and then dynamically create a query
with those "fixed/known" columns and "EXECUTE" it within a PL/PGSQL
function.

David J.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Nathan Boley
Sent: Tuesday, July 26, 2011 3:09 PM
To: PostgreSQL general
Subject: [GENERAL] select all rows where any column is NULL

Does anyone have a concise way of doing $SUBJECT?

Best,
Nathan

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


В списке pgsql-general по дате отправления:

Предыдущее
От: Nathan Boley
Дата:
Сообщение: select all rows where any column is NULL
Следующее
От: Radosław Smogura
Дата:
Сообщение: Re: variant column type