How to select based on the condition of a column exists

From: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: How to select based on the condition of a column exists
Date: 2022-08-26 14:01:27
Message-ID: CA+i5JwbpxnR2+Jb++hWG-98csG_rMbSaKbcg74+TUM7ez6c6VQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The following does not work.
select count(test) from table where exists (select test from table)

How to select based on the condition of a column exists? It column test
is not exists, a message need to be returned.

Regards,

David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2022-08-26 14:05:26 Re: How to select based on the condition of a column exists
Previous Message Lahnov, Igor 2022-08-26 11:43:47 RE: Unable to start replica after failover