Article View: borland.public.interbase.sql
Article #724Re: Combine data 2 records
From: Bill Todd
Date: Sun, 05 Aug 2007 23:53
Date: Sun, 05 Aug 2007 23:53
26 lines
1703 bytes
1703 bytes
MrT wrote: > When I do: > > select id, max(CRDRPT_RNW) from mempay2 > where id = 21 If there are columns in the SELECT clause that are not aggregates you must have a GROUP BY clause and all of the non-aggregate columns must be included in the GROUP BY clause. select id, max(CRDRPT_RNW) from mempay2 where id = 21 GROUP BY ID > > I get invalid column reference but this: > > select max(id), max(CRDRPT_RNW) from mempay2 > where id = 21 In this case all of the columns in the SELECT clause are aggregates so the GROUP BY clause is not required. -- Bill Todd (TeamB)
Technical Details
Message-ID:
<46b662de$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46b641b6@newsgroups.borland.com> <46b644a4$1@newsgroups.borland.com> <46b655fa@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,509bc3ea097a54b
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd" <no@no.com>
Subject: Re: Combine data 2 records
Newsgroups: borland.public.interbase.sql
References: <46b641b6@newsgroups.borland.com> <46b644a4$1@newsgroups.borland.com> <46b655fa@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.6
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 216.207.211.19
Message-ID: <46b662de$1@newsgroups.borland.com>
Date: 5 Aug 2007 16:53:02 -0700
X-Trace: newsgroups.borland.com 1186357982 216.207.211.19 (5 Aug 2007 16:53:02 -0700)
Lines: 26
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail