Re: need aid with this query

From: kibeha <>
Date: 2 Feb 2004 05:05:43 -0800
Message-ID: <>


I'd use :


   count(decode(customerbranch,null,1,null)) number_of_null_branches from t1
group by customernumber
having count(decode(customerbranch,null,1,null)) != 1;

The count(decode()) syntax will count null values in the customerbranch column.
The having clause ensures that you only get customernumbers with either zero or 2 or more null-values - so it also checks your requirement of only one null value :-)


KiBeHa Received on Mon Feb 02 2004 - 14:05:43 CET

Original text of this message