Re: Force 0?

From: Kalen Delaney (replies_at_public_newsgroups.com)
Date: 09/22/04


Date: Wed, 22 Sep 2004 16:08:01 -0700

BOL is your friend. :-)
It's right there in the definition of the SELECT ...

-- 
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Louis Davidson" <dr_dontspamme_sql@hotmail.com> wrote in message 
news:%23bYDMFOoEHA.324@TK2MSFTNGP11.phx.gbl...
>I had never heard of this.  Ever.  Wow, that could be handy.
>
> -- 
> ----------------------------------------------------------------------------
> Louis Davidson (drsql@hotmail.com)
> Compass Technology Management
>
> Pro SQL Server 2000 Database Design
> http://www.apress.com/book/bookDisplay.html?bID=266
>
> Note: Please reply to the newsgroups only unless you are
> interested in consulting services.  All other replies will be ignored :)
>
> "Kalen Delaney" <replies@public_newsgroups.com> wrote in message
> news:OKJSn$LoEHA.1668@TK2MSFTNGP14.phx.gbl...
>> Without sample input and output, I'm not exactly sure what you're asking.
>> My guess is that you want to include ALL MSNumber values, even if the
> WHERE
>> clause has removed some of them.
>>
>> If that is the case, try using GROUP BY ALL MSNumber
>>
>> -- 
>> HTH
>> ----------------
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>>
>> "ShadowVixen" <ShadowVixen@discussions.microsoft.com> wrote in message
>> news:187C40A8-A44F-4F92-889B-E7BAAAA69DB2@microsoft.com...
>> >I am running the following query:
>> >
>> > SELECT MSNumber, count(Expr1) as Expr1
>> > FROM dbo.UniquePCInfo
>> > WHERE (Site = 'MD')
>> > AND (OS='XP')
>> > group by MSNumber
>> >
>> > Is there a way to have a count of 0 returned if there are no records 
>> > for
> a
>> > particular number? I was thinking I might be able to do a case but I 
>> > can
>> > not
>> > seem to get that working. Any help is appreciated!
>>
>>
>
> 


Relevant Pages

  • Re: waitresource
    ... SQL Server MVP ... > Also on lock escalation, i think in your Inside SQL server 2000, you ... >> Kalen Delaney ... >> SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: PAE VS SQL Server AWE
    ... "Mike Epprecht " wrote in message ... > Mike Epprecht, Microsoft SQL Server MVP ... >> Kalen Delaney:-P) that when you shrink the kernel mode address space ...
    (microsoft.public.sqlserver.server)
  • Re: Protecting database
    ... I meant the metadata is available to anyone who can connect! ... "Kalen Delaney" wrote in message ... > SQL Server MVP ...
    (microsoft.public.sqlserver.security)
  • Re: Force 0?
    ... Pro SQL Server 2000 Database Design ... "Kalen Delaney" wrote in message ... > If that is the case, try using GROUP BY ALL MSNumber ...
    (microsoft.public.sqlserver.programming)
  • Re: Can view accept parameters
    ... Tibor Karaszi, SQL Server MVP ... >>Kalen Delaney ... >>> thks & rdgs ...
    (microsoft.public.sqlserver.server)