🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SUM(QUESTION)

#1130
From: Geoff Wass
Date: Wed, 13 May 1998 00:00
35 lines
1598 bytes
Keith,

I am just learning SQL (plus I am typing this off the top of my head),
so consult a SQL book to be sure I am doing it correctly:

SELECT SUM(I.AMOUNT) FROM INPUT I
    WHERE DIVISION = 1 AND COUNTRY = 1 AND WORK = 1

would be

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

Maybe the last part should be "GROUP BY I.DIVISION" - I am not sure.

I hope this points you in the right direction. I know it can be done. If
no one else can help with SQL here, there are a lot of SQL experts that
hang out in the InterBase group. They will not know dBASE but they will
really know SQL.


--
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: <35590D45.A88DECC4@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>

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: <35590D45.A88DECC4@ibm.net>
X-Deja-AN: 352757191
Content-Transfer-Encoding: 7bit
References: <6j8ia7$9br11@forums.borland.com> <3557DBDA.C21AD80@ibm.net> <6j9l9f$9vp14@forums.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: Noordindarus Consultancy Sdn. Bhd.
Mime-Version: 1.0
Newsgroups: borland.public.vdbase.data.sql