Problem with WHERE statement - Mailing list pgsql-novice

From Mark G. Franz
Subject Problem with WHERE statement
Date
Msg-id 019001c103eb$5d65e000$6401a8c0@mgflaptop
Whole thread Raw
List pgsql-novice
I am trying to retrieve DISTINCT records from a joined table set.  Here is a basic table layout;
 
Registration Table-
 
ID | Cost | Date
1  | 6.95  | 6/30/01
1  | 0.00  | 6/30/01
2  | 2.95  | 6/31/01
2  | 0.00  | 6/31/01
...
 
Customer Table-
 
ID | Name | Company
1  | Fred   | XYZ
2  | Tom   | ABC
 
My query string;
 
"SELECT DISTINCT Registration.ID, Registration.Cost, Customer.ID, Customer.Name, Customer.Company FROM Registration, Customer WHERE Customer.ID=Registration.ID AND Registration.Cost > 0.00"
 
This always returns every record that matches ID, I only want to return the record where the Cost is a true value.  Any ideas?
 
Mark
 
 

pgsql-novice by date:

Previous
From: "Jason Cox"
Date:
Subject: Starting Postgres using pg_ctl and options
Next
From: Allan Engelhardt
Date:
Subject: Character collating order