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 37d451f70407191529610a8eba@mail.gmail.com
Whole thread Raw
In response to Group by failing on Null values  (Caleb Simonyi-Gindele <csg@bordervet.ca>)
Responses locks and triggers. give me an advice please
List pgsql-sql
while you weren't looking, Caleb Simonyi-Gindele <csg@bordervet.ca> 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