Re: Force 0?
From: Kalen Delaney (replies_at_public_newsgroups.com)
Date: 09/22/04
- Next message: Peter Rilling: "Re: How to allow mutiple application to use the sysmessages table without conflicting?"
- Previous message: Saras Asnani: "Re: IF @@Rowcount..."
- In reply to: Louis Davidson: "Re: Force 0?"
- Next in thread: WangKhar: "Re: Force 0?"
- Reply: WangKhar: "Re: Force 0?"
- Reply: Louis Davidson: "Re: Force 0?"
- Messages sorted by: [ date ] [ thread ]
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! >> >> > >
- Next message: Peter Rilling: "Re: How to allow mutiple application to use the sysmessages table without conflicting?"
- Previous message: Saras Asnani: "Re: IF @@Rowcount..."
- In reply to: Louis Davidson: "Re: Force 0?"
- Next in thread: WangKhar: "Re: Force 0?"
- Reply: WangKhar: "Re: Force 0?"
- Reply: Louis Davidson: "Re: Force 0?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|