Received: from mimhimta.mim.com.au ([203.3.101.35]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA73477 for ; Mon, 28 Feb 2000 16:59:03 -0500 (EST) (envelope-from gedau@isa.mim.com.au) Received: from mimhexch2.mim.com.au (unverified) by mimhimta.mim.com.au (Content Technologies SMTPRS 4.1.2) with ESMTP id for ; Tue, 29 Feb 2000 08:00:37 +1000 Received: from isaexch3.isa.mim.com.au (ISAEXCH3 [158.54.7.84]) by mimhexch2.mim.com.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id F52Z7S34; Tue, 29 Feb 2000 07:59:47 +1000 Received: by ISAEXCH3 with Internet Mail Service (5.5.2448.0) id ; Tue, 29 Feb 2000 07:58:27 +1000 Message-ID: <69D6F577E4ADD311ABE600805FFE80580EBCFB@isaexch.isa.mim.com.au> From: George Dau To: "'pgsql-sql@postgresql.org'" Subject: RE: [SQL] prob with aggregate and group by - returns multiples Date: Tue, 29 Feb 2000 07:58:24 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="ISO-8859-1" The selects below are self-contained. The one that is failing is, in full, #!/bin/bash # psql web < writes: > select count(site), site from hits group by site; > The output contains lines like the following. Note that these are all > consecutive in the output. > 2|xlink.zdnet.com > 2|xlink.zdnet.com > 1|xlink.zdnet.com > 2|xlink.zdnet.com > 2|xlink.zdnet.com > 2|xlink.zdnet.com > 3|xlink.zdnet.com > 2|xlink.zdnet.com > 3|xlink.zdnet.com > 2|xlink.zdnet.com > 1|xlink.zdnet.com > Suspecting that there were differences in each xlink.zdnet.com, I counted > just them: > web=> select count (*) from hits where site='xlink.zdnet.com'; > count > ----- > 22 > (1 row) > So, all 22 xlink.zdnet.com are selected above, but they have not grouped in > the previous one. Any ideas why? Wow, that is bizarre. My first thought was that you had varying numbers of trailing blanks in the "site" values, but your second example seems to disprove that theory. What Postgres version are you running, and on what platform? Can you generate a self-contained example (a script that demonstrates the error from a standing start)? I suspect you may be hitting a platform- specific porting problem, but it's just speculation unless we have a self-contained test case to try on other machines. > On a lesser note: I tried "select * into temp from hits" as per the doco, > but it barfs. Postgres thinks that TEMP is a keyword, so it won't take it as a table name unless you put quotes around it. If we have doco examples that use TEMP as a table name, they need to be changed --- do you recall where you saw that, exactly? regards, tom lane ************************************************************** The information contained in this E-Mail is confidential and is intended only for the use of the addressee(s). If you receive this E-Mail in error, any use, distribution or copying of this E-Mail is not permitted. You are requested to forward unwanted E-Mail and address any problems to the MIM Holdings Limited Help Desk. E-Mail: helpdesk@mim.com.au or phone: Australia 07 3833 8042. **************************************************************