Thanks to visit codestin.com
Credit goes to postgrespro.com

Re: Group by failing on Null values - Mailing list pgsql-sql

From Rosser Schwarz
Subject Re: Group by failing on Null values
Date
Msg-id [email protected]
Whole thread Raw
In response to Group by failing on Null values  (Caleb Simonyi-Gindele <[email protected]>)
Responses locks and triggers. give me an advice please
List pgsql-sql
while you weren't looking, Caleb Simonyi-Gindele <[email protected]> wrote:

> How do I get it to produce a row even when dat_staff_code is null?

try something like

SELECT coalesce(dat_staff_code, 0)...GROUP BY dat_staff_code

That will substitute a zero for any NULL value in that column, which
GROUP BY should then pick up.

/rls

-- 
:wq


pgsql-sql by date:

Previous
From: Caleb Simonyi-Gindele
Date:
Subject: Group by failing on Null values
Next
From: sad
Date:
Subject: locks and triggers. give me an advice please