Hi Jeremie,
The sql query you suggested is cleaner and at least as efficient as the
current one. It was my first option but unfortunately it's not supported
by the newer versions of mysql. I've no idea why..
mysql> select xws_name, sum(xws_page_views) as pageviewcount from
xwikistatsdoc where xws_action='view' and xws_name like '%.%' group by
xws_name order by pageviewscount desc;
ERROR 1054 (42S22): Unknown column 'pageviewscount' in 'order clause'
Anyway, hibernate should be responsible for the correct translation from
hql to a specific sql dialect. A solution would be to use the (idea from
the) above sql but configure the dialect to MySQL5Dialect (in my case). I
have to test this. I'll give you feedback soon.
Best Regards,
Marius.
To be complete, this same error occurs for all the
Statistics panels ...
-----Original Message-----
From: BOUSQUET Jeremie
Sent: lundi 18 février 2008 15:50
To: 'XWiki Users'
Subject: RE: [xwiki-users] MySQL Error "invalid use of group function" in
Statistics application
Hi Marius and thanks,
Your SQL request returns the same error "invalid use of group function" in
my mysql version ...
BTW I could have it work by explicitly naming the sum, and using it in the
order by :
select xws_name, sum(xws_page_views) as pageviewcount from xwikistatsdoc
where
xws_action='view' and xws_name like '%.%' group by xws_name order by
pageviewscount desc
I believe it's a difference in behaviour between MySQL 1.4 and 1.5 ... Do
you want me to create a JIRA issue for this ?
Best Regards,
Jeremie
-----Original Message-----
From: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] On Behalf
Of Marius Dumitru Florea
Sent: lundi 18 février 2008 15:19
To: users(a)xwiki.org
Subject: Re: [xwiki-users] MySQL Error "invalid use of group function" in
Statistics application
Hi Jeremie,
Sorry for the inconvenience. Your tables' description seems fine. I
attached the description of my tables so you can check it for yourself. I
think it all resumes to the following SQL query:
select xws_name, sum(xws_page_views) from xwikistatsdoc where
xws_action='view' and xws_name like '%.%' group by xws_name order by
sum(xws_page_views) desc
This query is very similar to the one used for retrieving the Most Viewed
Pages. It works fine under:
mysql Ver 14.12 Distrib 5.0.45, for pc-linux-gnu (x86_64) using readline
5.2
It would be great if you could run this query and tell me if it works in
your case.
Best Regards,
Marius.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users