Re: Get the max viewd product_id for user_id

From: Jayadevan M <Jayadevan(dot)Maymala(at)ibsplc(dot)com>
To: Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-sql-owner(at)postgresql(dot)org
Subject: Re: Get the max viewd product_id for user_id
Date: 2010-12-06 02:55:21
Message-ID: OF3F686349.C2A60D0C-ON652577F1.000FE6C7-652577F1.001027C1@ibsplc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> > 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.
>
Good. It should, since we are joining on count and user_id. I was
surprised to see your mail which said it wouldn't :).

Regards,
Jayadevan

DISCLAIMER:

"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have received this e-mail in error, kindly
contact the sender and destroy all copies of the original communication.
IBS makes no warranty, express or implied, nor guarantees the accuracy,
adequacy or completeness of the information contained in this email or any
attachment and is not liable for any errors, defects, omissions, viruses
or for resultant loss or damage, if any, direct or indirect."

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Marc Mamin 2010-12-06 10:59:58 First aggregate with null support
Previous Message Mario Splivalo 2010-12-05 16:59:07 Re: Get the max viewd product_id for user_id