View Single Post
  #19 (permalink)  
Old 07-29-10, 11:29
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 239
Quote:
Originally Posted by nbtet View Post
as far as i know, use of the older PostgreSQL version should not be an issue in greenplum and it is an open-source PostgreSQL platform.
The problem is that the window function shammat uses (count(*) over (...)) was introduced in PostgreSQL 8.4. If greenplum is built upon an older version of PostgreSQL, then this function won't be present. This is why his code isn't working for you.

Try this:
Code:
select
    id,
    t_stamp
from click_log
where
    (id, extract(hour from t_stamp), extract(minute from t_stamp)::int / 15)
        in (
            select
                id,
                hr,
                intvl
            from (
                    select
                        id,
                        extract(hour from t_stamp) as hr,
                        extract(minute from t_stamp)::int / 15 as intvl
                    from click_log
                ) as intervals
            group by id, hr, intvl
            having count(hr || ':' || intvl) > 1
        )
order by id, t_stamp
You'll need to change the divisors to the appropriate interval.

Last edited by futurity; 07-29-10 at 12:06.
Reply With Quote