Re: R: R: How to check if 2 series of data are equal - Mailing list pgsql-general

From Octavio Alvarez
Subject Re: R: R: How to check if 2 series of data are equal
Date
Msg-id 1234500380.23861.4.camel@localhost.localdomain
Whole thread Raw
In response to Re: R: R: How to check if 2 series of data are equal  (Adrian Klaver <aklaver@comcast.net>)
List pgsql-general
On Thu, 2009-02-12 at 14:21 -0800, Adrian Klaver wrote:
> On Thursday 12 February 2009 11:37:37 am Paolo Saudin wrote:
>

>
> SELECT fulldate,sensor
>   FROM (SELECT fulldate,sensor,count(sensor)
>           FROM (SELECT 1 AS station, fulldate, meanvalue AS sensor FROM table1
> UNION
>                 SELECT 2, fulldate, meanvalue FROM table2 ORDER BY
> fulldate,sensor) AS  x
> GROUP BY fulldate,sensor) AS y
> WHERE y.count>1;
>
>
> and got-
>
>      fulldate       | sensor
> ---------------------+--------
>  2009-01-01 00:00:00 |   12.3
>  2009-01-01 02:00:00 |   82.1
>  2009-01-01 03:00:00 |   79.8
>  2009-01-01 04:00:00 |   77.2

You might want to do a UNION with all your tables to add a field to
identify the table, and use min() and max() to show the offending
tables.




pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: audit table
Next
From: Oleg Bartunov
Date:
Subject: Re: TSearch queries with multiple languages