pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michele Petrazzo - Unipex <michele.petrazzo@unipex.it>
To: Oliveiros d'Azevedo Cristina <oliveiros.cristina@marktest.pt>
Cc: pgsql-sql@postgresql.org
Subject: Re: all the table values equal
Date: Tue, 21 Sep 2010 16:43:25 +0200
Message-ID: <4C98C48D.1070103@unipex.it> (raw)
In-Reply-To: <5E43A989C2FA4F60B146DAC454BAA21D@marktestcr.marktest.pt>
References: <4C93803A.4080706@unipex.it>
	<438B32316EF6496D9641819BA16447A2@marktestcr.marktest.pt>
	<4C938D09.3050105@unipex.it>
	<81C545E3469E4DF58720C282A469E78A@marktestcr.marktest.pt>
	<4C9868AB.6050200@unipex.it>
	<5E43A989C2FA4F60B146DAC454BAA21D@marktestcr.marktest.pt>

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" and their value is equal to x ?"
>

Yes. All the users that have only one value into the "value" column and 
that value is NN.

> 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

Thanks,
Michele



view thread (10+ messages)  latest in thread

Message-ID: <4C98C48D.1070103@unipex.it>
Permalink:  ../4C98C48D.1070103@unipex.it/
Also on:    postgresql.org/message-id/4C98C48D.1070103@unipex.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: michele.petrazzo@unipex.it, oliveiros.cristina@marktest.pt
  Subject: Re: all the table values equal
  In-Reply-To: <4C98C48D.1070103@unipex.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox