select returning mysterious null rows - Mailing list pgsql-sql

From webmaster@duluoz.net
Subject select returning mysterious null rows
Date
Msg-id 20000222204332.22306.qmail@paradise.duluoz.net
Whole thread Raw
List pgsql-sql
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 amountfrom
billingb, domain d, opt_info i,opt_list_domains l, plans pwhere b.billed_thru <= '$today'and b.domain = d.domainand
l.domain= d.domainand i.sname = l.optand p.sname = d.base_plangroup 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



pgsql-sql by date:

Previous
From: Thomas Frei
Date:
Subject: HOWTO create BLOB fields?
Next
From: Gordon Clarke
Date:
Subject: pg_group system table