Yes. All the users that have only one value into the "value" column and
that value is NN.
Understood. Try the query from the previous mail, adding the clause WHERE
"value" = NN as I did explain.
Or will you need to find all the users that don't change value with just
one query? And the
problem
Best,
Oliver
- Original Message -
From: "Oliveiros d'Azevedo Cristina"
To: "Michele Petrazzo - Unipex"
Cc:
Sent: Tuesday, September 21, 2010 11:25 AM
Subject: Re: [SQL] all the table values equal
>
>>> It would help if you explain a lit
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
It would help if you explain a little better the background of the
problem you're trying to solve.
You want to find all the user IDs which have the same value on a
given time interval?
Is my understanding correct?
Yes.
Re-reading my post I saw that I could explain better!
id_user | value
To: "Oliveiros d'Azevedo Cristina"
Cc:
Sent:
Friday, September 17, 2010 4:45 PM Subject: Re: [SQL] all the table
values equal
Oliveiros d'Azevedo Cristina ha scritto:
Howdy , Michele,
Give this a try
om: "Michele Petrazzo - Unipex"
To: "Oliveiros d'Azevedo Cristina"
Cc: Sent:
Friday, September 17, 2010 4:45 PM Subject: Re: [SQL] all the table
values equal
Oliveiros d'Azevedo Cristina ha scritto:
Howdy , Michele,
Give this a try
SELECT id_user FROM t_your_table
time
interval?
Is my understanding correct?
Best,
Oliver
- Original Message -
From: "Michele Petrazzo - Unipex"
To: "Oliveiros d'Azevedo Cristina"
Cc:
Sent: Friday, September 17, 2010 4:45 PM
Subject: Re: [SQL] all the table values equal
Oliveiros d'
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
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
Best,
Oliveiros Cristina
- Original Message