Re: Get the max viewd product_id for user_id

From: Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Get the max viewd product_id for user_id
Date: 2010-12-05 16:59:07
Message-ID: 4CFBC4DB.90101@megafon.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 12/05/2010 05:57 PM, Mario Splivalo wrote:
> The issue in both approaches is that if I have two product_ids that are
> viewed same number of times and share the first place as most viewed
> products by that user, I'll get only one of them (LIMIT 1 OR MAX() can
> only return one row :).
>

And then, to jump again into my own mouth - your approach, Jayadevan,
correctly gives me both product_id's if they're viewed the same number
of times.

Mario

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jayadevan M 2010-12-06 02:55:21 Re: Get the max viewd product_id for user_id
Previous Message Mario Splivalo 2010-12-05 16:57:17 Re: Get the max viewd product_id for user_id