🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #70

Re: Percentage calculation with sql in one pass

#70
From: Klaas Wolters
Date: Fri, 09 Apr 1999 00:00
23 lines
1156 bytes
Gary White [dBVIPS] heeft geschreven in bericht
<370d8e8a.11512199@forums.borland.com>...
>Look at a LEFT OUTER JOIN to include unmatched rows.


I have tested it with the following SQL code

SELECT Patient.Type, COUNT( Patient.PatientID ),
COUNT( Patient_1.PatientID )
FROM "PATIENT.DB" Patient
   LEFT OUTER JOIN "PATIENT.DB" Patient_1
   ON  (Patient.PatientID = Patient_1.PatientID)
GROUP BY Patient.Type


But the result is a tabel with two of the same columns.
So to me it seems that the GROUP BY statement is applied after the
selection.

Any other suggestions.

Klaas Wolters.
Technical Details
Message-ID: <7esa7c$apq10@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7ei7k7$1i612@forums.borland.com> <370d8e8a.11512199@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,8f161b4a65d9c69a
X-Google-Attributes: gidff5a1,public
From: "Klaas Wolters" <triple.eye@tip.nl>
Subject: Re: Percentage calculation with sql in one pass
Date: 1999/04/09
Message-ID: <7esa7c$apq10@forums.borland.com>
X-Deja-AN: 465394567
References: <7ei7k7$1i612@forums.borland.com> <370d8e8a.11512199@forums.borland.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.vdbase.data.sql