Received: from paradise.duluoz.net (IDENT:qmailr@[206.58.39.200]) by hub.org (8.9.3/8.9.3) with SMTP id PAA03552 for ; Tue, 22 Feb 2000 15:43:45 -0500 (EST) (envelope-from webmaster@duluoz.net) From: webmaster@duluoz.net Received: (qmail 22308 invoked by uid 501); 22 Feb 2000 20:43:32 -0000 Message-ID: <20000222204332.22306.qmail@paradise.duluoz.net> Subject: select returning mysterious null rows To: pgsql-sql@postgresql.org Date: Tue, 22 Feb 2000 12:43:32 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi- I've got the following query: select d.domain, p.lname, b.period, b.billed_thru, sum(i.monthly*b.period*discount(b.period)::float) as amount from billing b, domain d, opt_info i, opt_list_domains l, plans p where b.billed_thru <= '$today' and b.domain = d.domain and l.domain = d.domain and i.sname = l.opt and p.sname = d.base_plan group by domain, lname, period, billed_thru It works fine when there are any matching tuples, but when there are no matches, I get a row returned anyway, with all null fields. The null tuple isn't returned if any other tuples are -- only by itself. Can anybody explain what's happening here? I'm using PostgreSQL 6.5.3, and I've seen this behaviour both in psql and through PHP. -mike -- Mike Glover webmaster@duluoz.net Duluoz Networks http://www.duluoz.net