🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.sqlinfo
Article #245

cOUNT(*) PROBLEM

#245
From: Mike MacKinnon
Date: Mon, 09 Oct 2000 00:00
69 lines
3597 bytes
Good morning! I hope someone can help me on this.

I have written a bit of code (see below) that extracts data from a database.
The problem is that I am getting the wrong count. The count returned is the
amount of lines in the specified position in the DB and not the amount of
lines that are >=20.

Can anyone see where I'm going wrong on the code?


Thanks

Mike


SELECT "Stock file Co 01"."Book Code", "Stock file Co 01"."Allocated stock",
"Stock file Co 01"."Stock Code", Count(*)
FROM "Batch/Serial Header file Co 01" "Batch/Serial Header file Co 01",
"Stock file Co 01" "Stock file Co 01"
WHERE "Batch/Serial Header file Co 01"."Stock Code" = "Stock file Co
01"."Stock Code" AND (("Stock file Co 01".Supplier='16') AND ("Stock file Co
01"."Discontinued Item"='N') OR ("Stock file Co 01".Supplier='52') AND
("Stock file Co 01"."Discontinued Item"='N') OR ("Stock file Co
01".Supplier='71') AND ("Stock file Co 01"."Discontinued Item"='N') OR
("Stock file Co 01".Supplier='34') AND ("Stock file Co 01"."Discontinued
Item"='N') OR ("Stock file Co 01".Supplier='28') AND ("Stock file Co
01"."Discontinued Item"='N') OR ("Stock file Co 01".Supplier='61') AND
("Stock file Co 01"."Discontinued Item"='N') OR ("Stock file Co
01".Supplier='2') AND ("Stock file Co 01"."Discontinued Item"='N') OR
("Stock file Co 01".Supplier='35') AND ("Stock file Co 01"."Discontinued
Item"='N') OR ("Stock file Co 01".Supplier='410') AND ("Stock file Co
01"."Discontinued Item"='N') OR ("Stock file Co 01".Supplier='168') AND
("Stock file Co 01"."Discontinued Item"='N') OR ("Stock file Co
01".Supplier='59') AND ("Stock file Co 01"."Discontinued Item"='N') OR
("Stock file Co 01".Supplier='75') AND ("Stock file Co 01"."Discontinued
Item"='N') OR ("Stock file Co 01".Supplier='86') AND ("Stock file Co
01"."Discontinued Item"='N'))
GROUP BY "Stock file Co 01"."Allocated stock", "Stock file Co 01"."Stock
Code"
HAVING ("Stock file Co 01"."Allocated stock">=20) OR ("Stock file Co
01"."Allocated stock">=20) OR ("Stock file Co 01"."Allocated stock">=20) OR
("Stock file Co 01"."Allocated stock">=20) OR ("Stock file Co 01"."Allocated
stock">=20) OR ("Stock file Co 01"."Allocated stock">=20) OR ("Stock file Co
01"."Allocated stock">=20) OR ("Stock file Co 01"."Allocated stock">=20) OR
("Stock file Co 01"."Allocated stock">=20) OR ("Stock file Co 01"."Allocated
stock">=20) OR ("Stock file Co 01"."Allocated stock">=20) OR ("Stock file Co
01"."Allocated stock">=20) OR ("Stock file Co 01"."Allocated stock">=20)
ORDER BY "Stock file Co 01"."Book Code", "Stock file Co 01"."Stock Code"




--



Mike MacKinnon
Systems Administrator
PG Power Distribution Ltd
Ballymount Road
Dublin 12
Rep. of Ireland

Tel          01-450-5553
Mobile    087-284-9756
*********************************************************
The worse the haircut, the slower it grows out....

*********************************************************
Technical Details
Message-ID: <3zgE5.5442$44.17216@news.iol.ie>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11355a,5ae13aaad616362e,start
X-Google-Attributes: gid11355a,public
From: "Mike MacKinnon" <MMacKinnon@pgpower.com>
Subject: cOUNT(*) PROBLEM
Date: 2000/10/09
Message-ID: <3zgE5.5442$44.17216@news.iol.ie>
X-Deja-AN: 679244848
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
X-Complaints-To: abuse@iol.ie
X-Trace: news.iol.ie 971085119 193.203.147.34 (Mon, 09 Oct 2000 10:51:59 BST)
Organization: Ireland On-Line Customer
X-MSMail-Priority: Normal
NNTP-Posting-Date: Mon, 09 Oct 2000 10:51:59 BST
Newsgroups: bit.listserv.sqlinfo