I have a table with the following values:
CUST_ID STATUS
1000000 NULL
1000001 ACTIVE
1000002 DEACT
where I do
select count(*),isnull(STATUS,'ACTIVE') as STATUS
from CUSTOMER_TABLE
grop BY STATUS
why do I get
1 ACTIVE
1 ACTIVE
1 DEACT
instead of
2 ACTIVE
1 DEACT
Any help appreaciated, BTW,I 'm using SQL server 7.0
problem with NULL
Moderator: General Moderators
- NetDragonX
- Forum Newbie
- Posts: 15
- Joined: Sat May 25, 2002 3:00 pm
- Location: Southern California
he would get a systax error.
I triedwith mysql and it worked 
I tried
Code: Select all
Select count(*), IFNULL(STATUS, 'ACTIVE') as nStatus From CUSTOMER_TABLE GROUP BY nStatus