🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SUM(QUESTION)

#1036
From: Geoff Wass
Date: Wed, 13 May 1998 00:00
34 lines
1523 bytes
Keith,

Now that I think about, the Select should be changed, too if you use
GROUP BY. If I recall any field used in GROUP BY must be listed
explicitly.

SELECT I.DIVISION, SUM(I.AMOUNT) FROM INPUT I, WORK W, COUNTRY C
    WHERE I.DIVISION = W.DD AND I.COUNTRY = C.COUNTRY AND I.WORK =
W.WORK
    GROUP BY DIVISION

or you could try:

SELECT I.DIVISION, I.COUNTRY, SUM(I.AMOUNT) FROM INPUT I, WORK W,
COUNTRY C
    WHERE I.DIVISION = W.DD AND I.COUNTRY = C.COUNTRY AND I.WORK =
W.WORK
    GROUP BY DIVISION, COUNTRY

Maybe none of these are correct, but I think you get the drift.

--
Geoff Wass
Kuala Lumpur, Malaysia


=============================================================
Please respond to a newsgroup posting by posting a reply (not e-mail).
In this way, all can help and all can learn!


=============================================================
Triumph is in the first syllable.
Technical Details
Message-ID: <35597071.447EAFE2@ibm.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6j8ia7$9br11@forums.borland.com> <3557DBDA.C21AD80@ibm.net> <6j9l9f$9vp14@forums.borland.com> <35590D45.A88DECC4@ibm.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,d5546114e3a7f07c
X-Google-Attributes: gidff5a1,public
From: Geoff Wass <gswass@ibm.net>
Subject: Re: SUM(QUESTION)
Date: 1998/05/13
Message-ID: <35597071.447EAFE2@ibm.net>
X-Deja-AN: 352833590
Content-Transfer-Encoding: 7bit
References: <6j8ia7$9br11@forums.borland.com> <3557DBDA.C21AD80@ibm.net> <6j9l9f$9vp14@forums.borland.com> <35590D45.A88DECC4@ibm.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Organization: Noordindarus Consultancy Sdn. Bhd.
Newsgroups: borland.public.vdbase.data.sql