Re: select ... count ... inner join statement
- From: "TB" <tbpostbox-googlegroups@xxxxxxxxx>
- Date: Mon, 4 Apr 2005 00:56:05 +0200
> It would help if we knew all the possible values for statusm but given
> what you've told us, the solution is as easy as:
>
> WHERE Status IN (0,2)
>
Status can be either 0,1 or 2.
I have just added the line you proposed to my SQL query, but the result is
precisely want do NOT want. Your addition adds a filter, thus not creating
lines where c is 0, i.e. no occurences of returned order from a particular
customer. I would like the COUNT property to count the number of instances
where status = 2, and when that count is 0, ALSO express that (by a zero).
With the filter you propose, instances that return zero are ommited.
>
> I hope you find one. I've never seen such a beast. :-)
> Have you tried searching amazon.com?
>
> Bob Barrows
I found this book:
"SQL in Easy Steps", written by Mike McGrath.
Amazon link:
http://www.amazon.co.uk/exec/obidos/ASIN/1840782579/ref=ord_cart_shr/026-8153264-1906838?%5Fencoding=UTF8&m=A3P5ROKL5A1OLE
Any opinions?
Thanks again.
TB
.
- Follow-Ups:
- Re: select ... count ... inner join statement
- From: Bob Barrows [MVP]
- Re: select ... count ... inner join statement
- References:
- select ... count ... inner join statement
- From: TB
- Re: select ... count ... inner join statement
- From: Bob Barrows [MVP]
- select ... count ... inner join statement
- Prev by Date: Re: select ... count ... inner join statement
- Next by Date: Re: select ... count ... inner join statement
- Previous by thread: Re: select ... count ... inner join statement
- Next by thread: Re: select ... count ... inner join statement
- Index(es):
Relevant Pages
|
|