max question - Mailing list pgsql-sql

From A. R. Van Hook
Subject max question
Date
Msg-id 425C0445.8020603@lake-lotawana.mo.us
Whole thread Raw
Responses Re: max question
Re: max question
Re: max question
List pgsql-sql
I have the following in a table:  oid   |   citkey   |  contby  |  contdate  | abcontinue |   ccdate  
---------+------------+----------+------------+------------+------------5774835 | 04-0594703 |          |            |
         |5775325 | 04-0594703 | Attorney | 04/06/2005 | 6          | 03/07/20055776060 | 04-0594703 | Attorney |
05/04/2005| 6          | 04/05/20055776067 | 04-0594703 | Attorney | 05/04/2005 | 6          | 04/05/2005
 

I am trying to pull rows that have the max. contdate. Why does the 
following give more than 2 rows?ql "select oid,* from ccontinue where citkey ='04-0594703' group by 
oid,citkey,contby,contdate,abcontinue,ccdate having max(contdate) = 
contdate"  oid   |   citkey   |  contby  |  contdate  | abcontinue |   ccdate  
---------+------------+----------+------------+------------+------------5776067 | 04-0594703 | Attorney | 05/04/2005 |
6         | 04/05/20055775325 | 04-0594703 | Attorney | 04/06/2005 | 6          | 03/07/20055776060 | 04-0594703 |
Attorney| 05/04/2005 | 6          | 04/05/2005
 
(3 rows)

thanks



pgsql-sql by date:

Previous
From: "Dan Feiveson"
Date:
Subject: Re: Query runs very slowly in Postgres, but very fast in other DBMS
Next
From: jspring@gmail.com
Date:
Subject: ignore single character in SELECT query?