RE: some problem

RE: some problem

 

  

select isnull(field1,'x'), count(isnull(field1,'x'))
from Yourtable
group by isnull(field1,'x')
order by isnull(field1,'x')

select field1, count(field1)
from Yourtable
group by field1
order by field1



the first method will tell you how many nulls are there also... the second
will not... count() ignores nulls

-----Original Message-----
From: Jumma Salim
[mailto:mssqldba-ezmlmshield-x39263952.[Email address protected]
Sent: Wednesday, July 27, 2005 3:12 PM
To: LazyDBA Discussion
Subject: some problem


Hello
I am doing a count for a column which has values 'Y';'N', 'Null'
And other columns for which I use group by column

Is it possible if so how do I displays the info as separate column

sj



---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


MS Sql Server LazyDBA home page