Oliveiros d'Azevedo Cristina ha scritto:
Howdy, Michelle,
Ciao
for each hour it will count the number of distinct user_id's there
are . If I understood correctly what you need...
Can you please test it and see if it is OK for your needs? With me,
it worked on the sample data you provided
Hi list,
Into a table like this:
id_user | my_date
and some data inside
1 | 2010/11/25 00:01:00
1 | 2010/11/25 00:02:00
1 | 2010/11/25 01:01:00
2 | 2010/11/25 02:01:00
3 | 2010/11/25 02:01:00
3 | 2010/11/25 02:06:00
1 | 2010/11/25 03:01:00
I'm looking for a query that say me, hour per hour, how
Oliveiros d'Azevedo Cristina ha scritto:
OK, So, analysing your new question, the time interval is still
important? Or no longer?
It's important but simple to translate into sql, so I remove it from my
question.
So writting your query in english : "I want all users that don't change
"value
3 | 4 | xxx+2
4 | 3 | xxx
4 | 3 | xxx+1
So, the new question: how I can find which id_user has _all_ the "value"
that I'm looking for? Say -1 as 3 and I want a id_user=2 for the first
and for the latter id_user=4
Thanks,
Michele
Best, Oliver
- Original Message ----- Fr
Oliveiros d'Azevedo Cristina ha scritto:
Howdy , Michele,
Give this a try
SELECT id_user FROM t_your_table WHERE datetime BETWEEN A -- plug
here beginning of interval AND B -- and end here GROUP BY id_user
HAVING COUNT(*) = -SUM(value)
Then tell me if it gives you what you want
Thanks,
it w
Hi list,
this is a Friday afternoon question... :)
I have a table like this:
id_user | value | datetime
1 | 1 | xxx
1 | 2 | xxx+1
1 | -1 | xxx+2
2 | -1 | xxx
2 | -1 | xxx+1
3 | 4 | xxx
3 | 10 | xxx+1
I'm trying to create a query that say me which id_user, inside a
interval of time, has all the v
Hi list,
I have two table that are so represented:
t1:
id int primary key
... other
t2:
id int primary key
t1id int fk(t1.id)
somedate date
... other
data t1:
1 | abcde
2 | fghi
data t2:
1 | 1 | 2010-05-23
2 | 1 | 2010-05-24
3 | 1 | 2010-05-25
4 | 2 | 2010-05-22
5 | 2 | 2010-05-26
I'm trying t
Pavel Stehule wrote:
CREATE FUNCTION getfoo(int) RETURNS foo AS $$ SELECT fooid, foosubid
FROM foo WHERE fooid = $1 LIMIT 1; $$ LANGUAGE SQL;
this return only one value, I need all the values that return the query
or
CREATE FUNCTION getfoo(int) RETURNS SETOF foo AS $$ SELECT fooid,
foosubi
Hi all.
I want that a function return a table rows (like the doc says at 33.4.4.
SQL Functions as Table Sources), but I want the a function return only a
few cols, so the same that I select into the func.
Modifying the doc example:
CREATE TABLE foo (fooid int, foosubid int, fooname text);
INSERT
Hi ml!
A question about cidr query. I'm tring to use the various cidr functions
to exclude a A sub class, but I don't understand how use it:
SELECT count(ip_addr), ip_addr from wi_log_network where ip_addr !=
network('10.10.0.0/16', 16) group by (ip_addr);
it don't exclude the 10.10 ! Tried als
10 matches
Mail list logo