nha schrieb:
Hello,
Le 23/07/09 10:23, Glenn Maynard a écrit :
On Thu, Jul 23, 2009 at 1:01 AM, Andreas wrote:
SELECT user_name, log_type_fk, COUNT(log_type_fk)
FROM log
JOIN users ON (user_id = user_fk)
WHERE (ts IS BETWEEN sometime AND another)
GROUP BY user_name, log_type_fk
ORD
Hello,
Le 23/07/09 10:23, Glenn Maynard a écrit :
> On Thu, Jul 23, 2009 at 1:01 AM, Andreas wrote:
>> SELECT user_name, log_type_fk, COUNT(log_type_fk)
>> FROM log
>> JOIN users ON (user_id = user_fk)
>> WHERE (ts IS BETWEEN sometime AND another)
>> GROUP BY user_name, log_type_fk
>> ORDER BY
On Thu, Jul 23, 2009 at 1:01 AM, Andreas wrote:
> SELECT user_name, log_type_fk, COUNT(log_type_fk)
> FROM log
> JOIN users ON (user_id = user_fk)
> WHERE (ts IS BETWEEN sometime AND another)
> GROUP BY user_name, log_type_fk
> ORDER BY user_name, log_type_fk
create table users (user_id intege
In response to A. Kretschmer :
> test=*# select foo.user_name, foo.log_type, sum(case when log_type_fk is
> not null then 1 else 0 end) from (select user_id, user_name,
> log_type_id, log_type from users cross join log_type) foo full join log
> on ((foo.user_id, foo.log_type_id)=(log.user_fk, log.l
In response to Andreas :
> Hi,
> The source select counts log-events per user.
> All is well when a user has at least one event per log_type in the log
> within a given timespan.
> If one log_type is missing COUNT() has nothing to count and there is
> expectedly no result line that says 0.
> BUT
Andreas wrote:
Hi,
The source select counts log-events per user.
All is well when a user has at least one event per log_type in the log
within a given timespan.
If one log_type is missing COUNT() has nothing to count and there is
expectedly no result line that says 0.
BUT I need this 0-line be
Hi,
The source select counts log-events per user.
All is well when a user has at least one event per log_type in the log
within a given timespan.
If one log_type is missing COUNT() has nothing to count and there is
expectedly no result line that says 0.
BUT I need this 0-line because of a cross