R: R: How to check if 2 series of data are equal - Mailing list pgsql-general
From | Paolo Saudin |
---|---|
Subject | R: R: How to check if 2 series of data are equal |
Date | |
Msg-id | 007501c98d49$5c9b9940$15d2cbc0$@it Whole thread Raw |
In response to | Re: R: How to check if 2 series of data are equal (Adrian Klaver <aklaver@comcast.net>) |
Responses |
Re: R: R: How to check if 2 series of data are equal
|
List | pgsql-general |
>-----Messaggio originale----- >Da: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] Per conto di Adrian Klaver >Inviato: giovedì 12 febbraio 2009 18.57 >A: Paolo Saudin >Cc: pgsql-general@postgresql.org >Oggetto: Re: R: [GENERAL] How to check if 2 series of data are equal >----- "Paolo Saudin" <paolo@ecometer.it> wrote: > >-----Messaggio originale----- > >Da: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org] Per conto di Adrian > Klaver > >Inviato: giovedì 12 febbraio 2009 17.28 > >A: pgsql-general@postgresql.org > >Cc: Paolo Saudin > >Oggetto: Re: [GENERAL] How to check if 2 series of data are equal > > >On Thursday 12 February 2009 12:06:41 am Paolo Saudin wrote: > >> Hi, > >> > >> I have 14 tables filled with meteorological data, one record per > parameter > >> per hour. The id field holds the parameter type (1=temperature, > 2=humidity > >> ...) My problem is that for short periods (maybe one week, one > month) there > >> are two stations with the same data, I mean the temperature of > table1 is > >> equal to the humidity of table3. I need to discover those cases. > > >Before I can start to answer this I need some clarification. How can > temperature > >and humidity be the same data? > > Can be the same data ( and it is ) because of errors in the remote > stations configurations. > The Stations and parameters IDs were mixed up resulting in same data > in different tables ... > >I am afraid I more confused now. From the table schema the value is a real number only and has no units. As I understandthe units >designation lies in the id. If the ids are mixed up I can't see how it is possible to differentiatebetween a value of 25 that maybe >degrees C or % relative humidity for instance. You are going to have to stepme through this. Yes, the parameter is defined by the id and stored in another table with the name, units and other properties. I need tofind out a sequence of meanvalues (without taking care of ids) which exists in another table Here is some sample data, I need to found out if some sequence of data in table1 is equal to data in table2, table3 ...tableN. Table1 fulldate, id, meanvalue 2009-01-01 00:00:00, 1, 12.3 -- temperature 2009-01-01 01:00:00, 1, 12.5 2009-01-01 02:00:00, 1, 12.6 2009-01-01 03:00:00, 1, 12.7 2009-01-01 04:00:00, 1, 12.8 2009-01-01 05:00:00, 1, 12.2 Table1 fulldate, id, meanvalue 2009-01-01 00:00:00, 2, 80.3 -- humidity 2009-01-01 01:00:00, 2, 81.6 2009-01-01 02:00:00, 2, 82.1 2009-01-01 03:00:00, 2, 79.8 2009-01-01 04:00:00, 2, 77.2 2009-01-01 05:00:00, 2, 77.1 ------------------------------------------------------------------ Table2 fulldate, id, meanvalue 2009-01-01 00:00:00, 1, 12.3 -- temperature 2009-01-01 01:00:00, 1, 11.8 2009-01-01 02:00:00, 1, 82.1 ! WRONG DATA - SAME AS Table2 id->2 2009-01-01 03:00:00, 1, 79.8 ! WRONG DATA - SAME AS Table2 id->2 2009-01-01 04:00:00, 1, 77.2 ! WRONG DATA - SAME AS Table2 id->2 2009-01-01 05:00:00, 1, 13.1 Table2 fulldate, id, meanvalue 2009-01-01 00:00:00, 2, 78.9 -- humidity 2009-01-01 01:00:00, 2, 76.4 2009-01-01 02:00:00, 2, 74.7 2009-01-01 03:00:00, 2, 73.1 2009-01-01 04:00:00, 2, 71.6 2009-01-01 05:00:00, 1, 70.8 Hope this might help, Paolo Saudin >Adrian Klaver >aklaver@comcast.net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
pgsql-general by date: