pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mario Splivalo <mario.splivalo@megafon.hr>
To: pgsql-sql@postgresql.org
Subject: Re: Get the max viewd product_id for user_id
Date: Sun, 05 Dec 2010 17:59:07 +0100
Message-ID: <4CFBC4DB.90101@megafon.hr> (raw)
In-Reply-To: <4CFBC46D.1080105@megafon.hr>
References: <4CF8CC26.70206@megafon.hr>
	<OF16FA4770.DCF7942F-ON652577EE.003F9FF3-652577EE.0040227D@ibsplc.com>
	<4CFBC46D.1080105@megafon.hr>

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



view thread (6+ messages)  latest in thread

Message-ID: <4CFBC4DB.90101@megafon.hr>
Permalink:  ../4CFBC4DB.90101@megafon.hr/
Also on:    postgresql.org/message-id/4CFBC4DB.90101@megafon.hr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mario.splivalo@megafon.hr
  Subject: Re: Get the max viewd product_id for user_id
  In-Reply-To: <4CFBC4DB.90101@megafon.hr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox