Skip site navigation (1) Skip section navigation (2)

Re: Oracle Analytical Functions

From: "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>
To: "'Willem Buitendyk'" <willem(at)pcfish(dot)ca>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Oracle Analytical Functions
Date: 2008-01-31 18:55:37
Message-ID: 012701c8643a$deaba210$9c02e630$ (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Hi Willem,

> for some reason the order by's aren't working.

Could you provide more details?  Do you get a specific error message?

> only returning 658 rows instead of the 750K.

You should not expect the same row count in both source table and
result set.  Even in your example -- you provided 8 source rows, and
4 result rows.  You can determine the correct number of results via
"the number of records, related to client_ids having two or more records 
in all_client_times, minus one".  It may be true that you have 750k
records but only 658 rows that satisfy this requirement.

What do you get for this query?

select count(*) from ( select client_id, count(*) as rows 
from all_client_times group by client_id having count(*) > 1 ) as x


In response to


pgsql-general by date

Next:From: HugoDate: 2008-01-31 19:16:48
Subject: variable table names in trigger functions
Previous:From: Willem BuitendykDate: 2008-01-31 18:37:37
Subject: Re: Oracle Analytical Functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group