> > 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 m
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
On 12/03/2010 12:40 PM, Jayadevan M wrote:
Hello,
I went this way, but for a large number of user_id's, it's quite slow:
CREATE VIEW v_views AS
SELECT user_id, product_id, count(*) as views
FROM viewlog
GROUP BY user_id, product_id
SELECT
DISTINCT user_id,
(SELECT product_
On 12/03/2010 12:40 PM, Jayadevan M wrote:
Hello,
I went this way, but for a large number of user_id's, it's quite slow:
CREATE VIEW v_views AS
SELECT user_id, product_id, count(*) as views
FROM viewlog
GROUP BY user_id, product_id
SELECT
DISTINCT user_id,
(SELECT product_