🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #1024

Re: Pls help with procedure

#1024
From: Arno Brinkman
Date: Sat, 10 Mar 2007 15:57
31 lines
2102 bytes
Hi,

> There is nothing to group. To use GROUP BY you must have at leas one
> aggregate function (MIN, MAX, COUNT, SUM, etc.) in the SELECT clause.
> If you want the result in a particular order use ORDER BY.

It's not mandatory to use an aggregate function if you've a GROUP BY clause, but Interbase doesn't 
support GROUP BY <ordinal>. Thus he must include the same expressions as in the select list into the 
GROUP BY clause, although IIRC Interbase doesn't support that too (EXTRACT(...) in the GROUP BY).
While using GROUP BY without aggregate functions is the same as DISTINCT is in this case DISTINCT 
anyway the best solution.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
  http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features :
  http://www.firebirdsql.org
  http://www.firebirdsql.info
  http://www.fingerbird.de/
  http://www.comunidade-firebird.org/

Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info 
Technical Details
Message-ID: <45f2d5b2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45f12ed6@newsgroups.borland.com> <45f17701$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,90802e9148f8740b
X-Google-Attributes: gid114a0e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Arno Brinkman" <bnewsgroups @ abvisie.nl>
Newsgroups: borland.public.interbase.sql
References:  <45f12ed6@newsgroups.borland.com> <45f17701$1@newsgroups.borland.com>
Subject: Re: Pls help with procedure
Date: Sat, 10 Mar 2007 16:57:47 +0100
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 82.93.4.208
Message-ID: <45f2d5b2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1173542322 82.93.4.208 (10 Mar 2007 07:58:42 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail