Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
stupid noob question Group by |
Wed, Jun 14 2006 5:29 PM | Permanent Link |
Marc Pelletier | Hello,
I have a table, Linelist with the following structure: with FieldDefs do begin Clear; Add( 'LineID', ftAutoInc, 0, false ); Add( 'LineName', ftString, 30, false ); Add( 'Flight', ftInteger, 0, false ); Add( 'StartTime', ftFloat, 0, false ); Add( 'EndTime', ftFloat, 0, false ); Add( 'DVD_Label', ftString, 10, false ); end; It is populated with about 250 records. I am trying to do a very simple query but for some reason it won't work. 'Select min(starttime), max( endtime ) from Linelist group by Flight' It cacks with a message stating it was expecting a column name and got 'Flight'. I've tried capitalizing, quoting etc but no luck. Simple, I know. Please illuminate a poor stupid soul. cheers Marc Pelletier |
Wed, Jun 14 2006 6:21 PM | Permanent Link |
Marc Pelletier | Marc Pelletier <marc@stopspam.goldak.ca> wrote in
news:Xns97E29C9F58BF4mmpp1234.dd@64.65.248.118: > 'Select min(starttime), max( endtime ) from Linelist group by Flight' > > 'Select min(starttime), max( endtime ), Flight from Linelist group by > Flight' Incredibly, none of the sql primers I consulted mentioned that the group by field has to be part of the result set. The error message was a bit misleading, but I can see how it makes sense from the sql engine. It is looking at the result set and I was thinking of the source. cheers Marc Pelletier |
Thu, Jun 15 2006 1:36 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Marc,
<< Incredibly, none of the sql primers I consulted mentioned that the group by field has to be part of the result set. The error message was a bit misleading, but I can see how it makes sense from the sql engine. It is looking at the result set and I was thinking of the source. >> Yes, DBISAM requires that all GROUP BY columns exist in the result set. -- Tim Young Elevate Software www.elevatesoft.com |
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 |