Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Sum of sum |
Tue, Aug 18 2009 6:56 AM | Permanent Link |
"Eduardo [HPro]" | If I have two tables like below:
Table1 ==== Field1 Field2 Table2 ==== Field1 Field2 And I need to get a sum of Field2 from both tables select field1, sum(field2) as tot into memory\m1 from table1 group by field1 union all select field1, sum(field2) as tot from table2 group by field1 ; select field1,sum(tot) from memory\m1 group by field1 My question: Is there another way to do this ? Or a better way to do this ? Thanks in advance Eduardo |
Wed, Aug 19 2009 3:59 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Eduardo,
<< My question: Is there another way to do this ? Or a better way to do this ? >> Nope, that's the way to do it. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Aug 19 2009 6:44 PM | Permanent Link |
"Rita" | "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message news:88377233-EF7C-4FC2-9044-41F31AD239A6@news.elevatesoft.com... > > Nope, that's the way to do it. > Not exactly true I like the grin tho. I used 2 EHLIB grids on a popup form from a button marked Sum on my cab app. As Ed is only using 2 fields from both tables even better. My grid does sums so it was way easy I dont have the code anymore as its sold. But look at attached pic at the sum on the bottom line. It should help but then it not SQL but Ed wanted a quicker way and my way that was always live. Rita Attachments: sum.png |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |