Problem with WHERE statement

Поиск
Список
Период
Сортировка
От Mark G. Franz
Тема Problem with WHERE statement
Дата
Msg-id 019001c103eb$5d65e000$6401a8c0@mgflaptop
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "Jason Cox"
Дата:
Сообщение: Starting Postgres using pg_ctl and options
Следующее
От: Allan Engelhardt
Дата:
Сообщение: Character collating order