Article View: borland.public.interbase.sql
Article #778Re: SQL Help
From: WillR
Date: Thu, 12 Jul 2007 21:44
Date: Thu, 12 Jul 2007 21:44
45 lines
1588 bytes
1588 bytes
Roy wrote: > Hi, > > I have an Interbase table with the following fields > > START_DATETIME > TRAFFIC > ROUTE_NAME > > I want to be able to retrieve the MAX(TRAFFIC) for a particular ROUTE_NAME > on a particular day (0ne record for the day) ; > > but the Select statement > > > SELECT START_DATE,ROUTE_NAME, MAX(TRAFFIC) from SYSTRAFFIC where > START_DATETIME = '2007/1/1' GROUP BY > START_DATETIME,ROUTE_NAME > > > returns all values for the traffic for all the hours of the day (24 Records) > > How can I achieve that. > > > Thanks very much for your help. > > Rgds > Roy > > and with only "GROUP BY ROUTE_NAME" you get what? -- Will R PMC Consulting
Technical Details
Message-ID:
<4696a07b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<46969c24@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,8f88f6177bf0b125 X-Google-Attributes: gid114a0e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 12 Jul 2007 17:44:12 -0400 From: WillR <willrNo.Spam.pmccl.noSpam.com> User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 Newsgroups: borland.public.interbase.sql Subject: Re: SQL Help References: <46969c24@newsgroups.borland.com> In-Reply-To: <46969c24@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 74.115.165.32 Message-ID: <4696a07b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1184276603 74.115.165.32 (12 Jul 2007 14:43:23 -0700) Lines: 45 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail