Re: all the table values equal - Mailing list pgsql-sql

From Oliveiros d'Azevedo Cristina
Subject Re: all the table values equal
Date
Msg-id D927FA316ABB44BE8F91E892454BFAA4@marktestcr.marktest.pt
Whole thread Raw
In response to all the table values equal  (Michele Petrazzo - Unipex <michele.petrazzo@unipex.it>)
List pgsql-sql
>
> 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 query would return something like
>>
>> id_user | value
>> 2 | -1
>> 4| 3
>>
>
>
> A right result for me, based by my data, will be:
>
> // choosing -1 like value
> id_user
> 2
>
> // choosing 3 like value
> id_user
> 4
>
> and if I add to the table:
> id_user | value | datetime
> 5 | -1  | xxx
> 5 | -1  | xxx +1
>
>
> // choosing -1 like value
> id_user
> 2
> 5
Understood. From the query I sent you just eliminate the "value" column 
from the select list, as you are not interested in it.

> Thanks,
> Michele

Best,
Oliver 



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slow response in select
Next
From: Adrian Johnson
Date:
Subject: Help with queries.