🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Combine data 2 records

#726
From: MrT
Date: Mon, 06 Aug 2007 02:30
27 lines
1736 bytes
Bill Todd wrote:
> 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.
> 


The id is the only one effectively GROUP BY.
Technical Details
Message-ID: <46b679a5@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.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
References: <46b641b6@newsgroups.borland.com> <46b644a4$1@newsgroups.borland.com> <46b655fa@newsgroups.borland.com> <46b662de$1@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
Date: Sun, 05 Aug 2007 21:30:56 -0500
From: MrT <contact@heat-mi.org>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.interbase.sql
Subject: Re: Combine data 2 records
References: <46b641b6@newsgroups.borland.com> <46b644a4$1@newsgroups.borland.com> <46b655fa@newsgroups.borland.com> <46b662de$1@newsgroups.borland.com>
In-Reply-To: <46b662de$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.39.70.226
Message-ID: <46b679a5@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1186363813 69.39.70.226 (5 Aug 2007 18:30:13 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.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