Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
group by |
Fri, Mar 30 2012 7:52 AM | Permanent Link |
Uffe Kousgaard | What is the correct way to express this in DBISAM 3?
select yearof(adatefield) as "year", sum(avaluefield) from atable group by year I hope all understands what I want to happen. |
Fri, Mar 30 2012 9:07 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Uffe
>select yearof(adatefield) as "year", sum(avaluefield) >from atable >group by year SELECT EXTRACT(YEAR FROM adatefield) AS YEAR, SUM(avaluefield) FROM atable GROUP BY EXTRACT(YEAR FROM adatefield) but I suggest you call the year something else since it clashes with one of Tim's keywords. It works but I'm always wary of things like that. Roy Lambert [Team Elevate] |
Mon, Apr 2 2012 11:20 AM | Permanent Link |
Robert Kaplan | "Roy Lambert" <roy@lybster.me.uk> wrote in message news:57F4CF85-7387-4BD9-891B-F8F2B60CA098@news.elevatesoft.com... > Uffe > >>select yearof(adatefield) as "year", sum(avaluefield) >>from atable >>group by year > > SELECT EXTRACT(YEAR FROM adatefield) AS YEAR, SUM(avaluefield) > FROM atable > GROUP BY EXTRACT(YEAR FROM adatefield) > > but I suggest you call the year something else since it clashes with one > of Tim's keywords. It works but I'm always wary of things like that. GROUP BY 1 would also work (group by the first field) RK |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |