Article View: borland.public.vdbase.data.sql
Article #1046Re: SUM(QUESTION)
From: Keith A. Towell
Date: Thu, 14 May 1998 00:00
Date: Thu, 14 May 1998 00:00
27 lines
1571 bytes
1571 bytes
This would only get the the SUM of the Amount for the country with out regard for what work area it is. I would have to limit even further do it 10 times and then do it for each country 10 times. This is how I currently do it. I then stick it into an array and then I can start building the report. There has to be a more efficient way of handling this. Keith Keith G. Chuvala (TeamB) wrote in message <355A0F02.8DEC8988@DELETE_THIS.hit.net>... >> SELECT I.DIVISION, I.COUNTRY, SUM(I.AMOUNT WHERE I.W = "1"), SUM(I.AMOUNT >> WHERE I.W = "2"), SUM(I.AMOUNT WHERE I.W = "3"),SUM(I.AMOUNT WHERE I.W = >> "4") FROM INPUT I > > >I think I understand what you're after. Try this: > > select division,country,sum(amount) from input group by division,country > >This will give you an answer table with the sum of Amount for each COUNTY >within each DIVISION. > >kgc
Technical Details
Message-ID:
<6jfmct$evd16@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6j8ia7$9br11@forums.borland.com> <3557DBDA.C21AD80@ibm.net> <6j9l9f$9vp14@forums.borland.com> <35590D45.A88DECC4@ibm.net> <35597071.447EAFE2@ibm.net> <6jcoho$d1v8@forums.borland.com> <355A0F02.8DEC8988@DELETE_THIS.hit.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: "Keith A. Towell" <katowell@1stConnect.com> Subject: Re: SUM(QUESTION) Date: 1998/05/14 Message-ID: <6jfmct$evd16@forums.borland.com> X-Deja-AN: 353317723 References: <6j8ia7$9br11@forums.borland.com> <3557DBDA.C21AD80@ibm.net> <6j9l9f$9vp14@forums.borland.com> <35590D45.A88DECC4@ibm.net> <35597071.447EAFE2@ibm.net> <6jcoho$d1v8@forums.borland.com> <355A0F02.8DEC8988@DELETE_THIS.hit.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.vdbase.data.sql