At 10:21 PM -0500 6/1/2000, Ed Loehr wrote:
>Michael Blakeley wrote:
>>
>> CREATE TABLE EVENTS( stamp date, id varchar(16), event varchar(128) );
>>
>> I'm trying to find the average age of the records. I've gotten as far as:
>> SELECT DISTINCT ON(id) age(stamp) FROM EVENTS;
>>
>> Now,
Michael Blakeley wrote:
>
> CREATE TABLE EVENTS( stamp date, id varchar(16), event varchar(128) );
>
> I'm trying to find the average age of the records. I've gotten as far as:
> SELECT DISTINCT ON(id) age(stamp) FROM EVENTS;
>
> Now, I need the DISTINCT ON(id), but that means I can't s
* Michael Blakeley <[EMAIL PROTECTED]> [000601 19:09] wrote:
> I hope someone on the list can suggest a solution for me - given a table like
>
> CREATE TABLE EVENTS( stamp date, id varchar(16), event varchar(128) );
>
> I'm trying to find the average age of the records. I've gotten as far as:
>
Michael Blakeley <[EMAIL PROTECTED]> writes:
> I'm trying to find the average age of the records. I've gotten as far as:
> SELECT DISTINCT ON(id) age(stamp) FROM EVENTS;
> Now, I need the DISTINCT ON(id), but that means I can't simply avg() the age:
> ERROR: Attribute events.id must
I hope someone on the list can suggest a solution for me - given a table like
CREATE TABLE EVENTS( stamp date, id varchar(16), event varchar(128) );
I'm trying to find the average age of the records. I've gotten as far as:
SELECT DISTINCT ON(id) age(stamp) FROM EVENTS;
Now, I need the D