This discussion is archived
6 Replies Latest reply: Feb 8, 2013 2:56 PM by Frank Kulash RSS

How to pull a max value/first value for duplicates in a group in a query?

990022 Newbie
Currently Being Moderated
Hi everybody,

[Oracle 10g]

I'm working with two tables, tblPatient and tblProgressNotes. The fields I'm working with are:
<pre>
<li>tblPatient.PatientID</li>
<li>tblPatient.EpisodeNumber (this tracks the number of hospital visits)</li>
<li>tblPatient.DischargeDate</li>
<li>tblProgressNotes.Height</li>
<li>tblProgressNotes.Weight</li>
<li>tblProgressNotes.Girth</li>
<li>tblProgressNotes.EntryDate</li>
<li>tblProgressNotes.EntryTime</li>
</pre>

From the fields above, I need to pull the most recent episode for each patient and each unique entry date so I can collect the height, weight, girth, and chart the plots on a graph. The problem I'm running into, though, is that there may be multiple entries on a given day. I can get the most recent episode for each patient with a "WHERE tblPatient.DischargeDate Is Null," but I'm not sure how to pull just the unique dates for each patient.

For instance, if I have the following:
<pre>
     <u>PatientID EpisodeNumber EntryDate EntryTime Height Weight Girth</u>
1 1 01.01.13 1:03 PM 66 185 35.5
1 1 01.01.13 7:18 PM 66 184 36
1 1 01.07.13 8:57 AM 66 190 36
1 1 01.07.13 11:32 AM 66 189 35.5
</pre>

For the first two records, I only want to return one record on 01.01.13. What I would really like, if there is more than one entry on a single day, is to take the average of the height, weight, and girth entries for that day and return a single record (I don't need the time entries, but I included them initially for testing). So, this is what my desired output would look like:

<pre>
     <u>PatientID EpisodeNumber EntryDate Height Weight Girth</u>
1 1 01.01.13 66 184.5 35.75
1 1 01.07.13 66 189.5 35.75
</pre>

If it's not possible to write a query like the above, then I would like to take the first entry for each day where there are multiple entries on that day. So, this would be the desired output (I included the EntryTime again so you can compare to the original example):

<pre>
     <u>PatientID EpisodeNumber EntryDate EntryTime Height Weight Girth</u>
1 1 01.01.13 1:03 PM 66 185 35.5
1 1 01.07.13 8:57 AM 66 190 36
</pre>

Thanks for your help.
  • 1. Re: How to pull a max value and the first value for a group in the same query?
    sb92075 Guru
    Currently Being Moderated
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ
  • 2. Re: How to pull a max value/first value for duplicates in a group in a query?
    Frank Kulash Guru
    Currently Being Moderated
    Hi,

    Welcome to the forum!
    987019 wrote:
    Hi everybody,

    [Oracle 10g]

    I'm working with two tables, tblPatient and tblProgressNotes. The fields I'm working with are:
    <pre>
    <li>tblPatient.PatientID</li>
    <li>tblPatient.EpisodeNumber (this tracks the number of hospital visits)</li>
    <li>tblPatient.DischargeDate</li>
    <li>tblProgressNotes.Height</li>
    <li>tblProgressNotes.Weight</li>
    <li>tblProgressNotes.Girth</li>
    <li>tblProgressNotes.EntryDate</li>
    <li>tblProgressNotes.EntryTime</li>
    </pre>
    Whenever you have a question, please post CREATE TABLE and INSERT statements for your sample data.
    See the forum FAQ {message:id=9360002}

    You must have some other column(s), such as tblprogressnotes.episodenumber, that show which rows in one table are related to which rows in the other.
    Why do you have a separate column for entrytime? DATEs in Oracle always include hours, minutes and seconds. It sounds like this whiole problem revolves around the fact that you are using the hours, minutes and seconds in entrydate, and so "GROUP BY entrydate" isn't an option.
    From the fields above, I need to pull the most recent episode for each patient and each unique entry date so I can collect the height, weight, girth, and chart the plots on a graph. The problem I'm running into, though, is that there may be multiple entries on a given day. I can get the most recent episode for each patient with a "WHERE tblPatient.DischargeDate Is Null," but I'm not sure how to pull just the unique dates for each patient.

    For instance, if I have the following:
    <pre>
         <u>PatientID EpisodeNumber EntryDate EntryTime Height Weight Girth</u>
    1 1 01.01.13 1:03 PM 66 185 35.5
    1 1 01.01.13 7:18 PM 66 184 36
    1 1 01.07.13 8:57 AM 66 190 36
    1 1 01.07.13 11:32 AM 66 189 35.5
    </pre>
    For the first two records, I only want to return one record on 01.01.13. What I would really like, if there is more than one entry on a single day, is to take the average of the height, weight, and girth entries for that day and return a single record (I don't need the time entries, but I included them initially for testing). So, this is what my desired output would look like:

    <pre>
         <u>PatientID EpisodeNumber EntryDate Height Weight Girth</u>
    1 1 01.01.13 66 184.5 35.75
    1 1 01.07.13 66 189.5 35.75
    </pre>
    You probably want something like this:
    SELECT       p.patientid
    ,       p.episodenumber
    ,       TRUNC (n.entrydate)     AS entry_date
    ,       AVG (n.height)     AS height_for_day
    ,       AVG (n.weight)     AS weight_for_day
    ,       AVG (n.girth)          AS girth_for_day
    FROM       tblpatient         p
    JOIN       tblprogressnotes  n  ON  n.episodenumber  = p.episodenumber
    WHERE       p.dischargedate   IS NULL
    GROUP BY  p.patientid
    ,       p.episodenumber
    ,       TRUNC (n.entrydate)
    ;
    If it's not possible to write a query like the above, then I would like to take the first entry for each day where there are multiple entries on that day. So, this would be the desired output (I included the EntryTime again so you can compare to the original example):

    <pre>
         <u>PatientID EpisodeNumber EntryDate EntryTime Height Weight Girth</u>
    1 1 01.01.13 1:03 PM 66 185 35.5
    1 1 01.07.13 8:57 AM 66 190 36
    </pre>
    That's an example of a Top-N Query . In some ways, it's actually harder to do than what you really want, but it's certainly possible.
  • 3. Re: How to pull a max value/first value for duplicates in a group in a query?
    990022 Newbie
    Currently Being Moderated
    Sorry about not providing the sample data, but I haven't ever created tables in an Oracle database...I've only ever written queries to access and analyze the data. To teach myself how to write the syntax for creating a table and inserting records would take me longer than I can afford to spend trying to resolve this issue.

    That being said, since my first post was missing information, here's my sample query that pulls everything from the two tables I'm working with:
    SELECT
            P.PATID,
            P.EPISODE_NUMBER,
            P.DATE_OF_DISCHARGE,
            M.ENTRY_DATE,
            M.ENTRY_TIME,
            M.GIRTH,
            M.HEIGHT,
            M.WEIGHT
    FROM
            TBLPATIENT P LEFT OUTER JOIN
            TBLPROGRESSNOTES M ON
            (
                    (P.PATID = M.PATID) AND
                    (P.EPISODE_NUMBER = M.EPISODE_NUMBER)
            )
    WHERE
            P.DATE_OF_DISCHARGE IS NULL AND
            M.ENTRY_DATE BETWEEN (SYSDATE - 60) AND SYSDATE AND
            M.HEIGHT <> 0 AND
            M.WEIGHT <> 0
    ORDER BY
            P.PATIENTID,
            M.ENTRY_DATE,
            M.ENTRY_TIME
    In the examples I provided, the Entry_Date field is datetime, but the time portion isn't used (it's 00:00:00). The EntryTime field is used instead and is a string/VARCHAR type. This database is the backend for an enterprise application that I only have read access to, so I don't know why they did what they did with the time field.

    I can't group by EntryDate because the values in the Height/Weight/Girth fields may not be the same for a given date. If I group by EntryDate and the values in the Height/Weight/Girth fields are different for two entries on the same date, then grouping by EntryDate will still return two records for that date. I would really like to pull only one record per date, per patient, AND if there are multiple entries for a single date, take the average of the Height/Weight/Girth fields and return that in the single record that is returned.

    Like I mentioned in my original post, the EntryTime isn't important for my desired output...I was just using it to test something else and I included it in hopes to show the kind of descrepancy I'm faced with, since the system doesn't use the time portion of the datetime field +(I realize I did a poor job of displaying the true format of the datetime and for that I apologize)+.

    I had looked into Top-N, but it didn't look like I could use it in conjuction with anything else to get the averages of the Height/Weight/Girth fields for duplicate dates for a single patient. I also didn't know how to apply Top-N to my situation since I don't want the Top-N EntryDate for the patient...at the least, I want the Top-N EntryDate for each EntryDate and patient. However, I would really prefer to find out how to produce the second table in my original post so I can show the average of all Height/Weight/Girth entries for every unique EntryDate for each patient.

    Thanks for your help.
  • 4. Re: How to pull a max value/first value for duplicates in a group in a query?
    Frank Kulash Guru
    Currently Being Moderated
    Hi,
    987019 wrote:
    Sorry about not providing the sample data, but I haven't ever created tables in an Oracle database...I've only ever written queries to access and analyze the data. To teach myself how to write the syntax for creating a table and inserting records would take me longer than I can afford to spend trying to resolve this issue.
    Don't be ridic. The forum FAQ {message:id=9360002} shows all you need to know for now.
    If it's easier to post a WITH clause containing your sample data, then do that. Again, see the forum FAQ for an example.

    You'll need to learn how to create and populate tables anyway, even if you rjob is just writing queries. You need to create sample data to develop and test your queries.
    There won't always be real data that someone else created for you.
    If there is sample data, it won't always have the scenarios you need to test.
    If there is sample data and it has the right senarios, you won't always be able to find them.
    If there is sample data and it has the right scenarios and you are able to find them, you might still find it easier to fabricate some test data yourself.
    That being said, since my first post was missing information, here's my sample query that pulls everything from the two tables I'm working with:
    SELECT
    P.PATID,
    P.EPISODE_NUMBER,
    P.DATE_OF_DISCHARGE,
    M.ENTRY_DATE,
    M.ENTRY_TIME,
    M.GIRTH,
    M.HEIGHT,
    M.WEIGHT
    FROM
    TBLPATIENT P LEFT OUTER JOIN
    TBLPROGRESSNOTES M ON
    (
    (P.PATID = M.PATID) AND
    (P.EPISODE_NUMBER = M.EPISODE_NUMBER)
    )
    WHERE
    P.DATE_OF_DISCHARGE IS NULL AND
    M.ENTRY_DATE BETWEEN (SYSDATE - 60) AND SYSDATE AND
    M.HEIGHT <> 0 AND
    M.WEIGHT <> 0
    Are the last two conditions inequalities?
    This site doesn;t like to display the &lt;&gt; inequality operator. Always use the other (equivalent) inequality operator, !=, when posting here.
    ORDER BY
    P.PATIENTID,
    M.ENTRY_DATE,
    M.ENTRY_TIME
    In the examples I provided, the Entry_Date field is datetime, but the time portion isn't used (it's 00:00:00). The EntryTime field is used instead and is a string/VARCHAR type. This database is the backend for an enterprise application that I only have read access to, so I don't know why they did what they did with the time field.

    I can't group by EntryDate because the values in the Height/Weight/Girth fields may not be the same for a given date.
    That's exactly why you would GROUP BY entrydate.
    If I group by EntryDate and the values in the Height/Weight/Girth fields are different for two entries on the same date, then grouping by EntryDate will still return two records for that date.
    No, "GROUP BY entrydate" means the result set will have 1 row per entrydate, even if the original table has 2, 3, or 4000 rows rows with the same entrydate.
    I would really like to pull only one record per date, per patient, AND if there are multiple entries for a single date, take the average of the Height/Weight/Girth fields and return that in the single record that is returned.
    Then use the AVG aggregate function, and GROUP BY, as I showed earlier.
    Like I mentioned in my original post, the EntryTime isn't important for my desired output...I was just using it to test something else and I included it in hopes to show the kind of descrepancy I'm faced with, since the system doesn't use the time portion of the datetime field +(I realize I did a poor job of displaying the true format of the datetime and for that I apologize)+.

    I had looked into Top-N, but it didn't look like I could use it in conjuction with anything else to get the averages of the Height/Weight/Girth fields for duplicate dates for a single patient.
    No,. You said that if you couldn't get the averages per date, you would settle for the first reading per date. That's what a Top-N query would be good for. I didn't go into much detail about Top-N queries because you don't need one here.
    I also didn't know how to apply Top-N to my situation since I don't want the Top-N EntryDate for the patient...
    No, if you were to use a Top-N Query, you would want the Top N readings (N=1 in this case) per patient per day.
    at the least, I want the Top-N EntryDate for each EntryDate and patient. However, I would really prefer to find out how to produce the second table in my original post so I can show the average of all Height/Weight/Girth entries for every unique EntryDate for each patient.
    It looks like you just need to add AVG and GROUP BY to the query you posted above, very much like what I posted earlier.
    You'll need to remove the entrytime column (which you don't need anyway), or make it an aggregate (e.g. <tt> MIN (entrytime) </tt> ).
  • 5. Re: How to pull a max value/first value for duplicates in a group in a query?
    990022 Newbie
    Currently Being Moderated
    Here's some sample data:
    CREATE TABLE TBLPATIENT
    (
            PATID VARCHAR2 (20),
            EPISODE_NUMBER DOUBLE,
            DATE_OF_DISCHARGE DATE
    );
    
    CREATE TABLE TBLPROGRESSNOTES
    (
            PATID VARCHAR2 (20),
            EPISODE_NUMBER DOUBLE,
            DATA_ENTRY_DATE DATE,
            GIRTH VARCHAR2 (5),
            HEIGHT DOUBLE,
            WEIGHT DOUBLE,
    );
    
    INSERT INTO TBLPATIENT VALUES (1, 1);
    INSERT INTO TBLPATIENT VALUES (2, 1);
    
    // For the first 3 records, the height stays the same, but the girth and weight values are variable on the same day
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 36, 66, 184);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 35.5, 66, 185);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 35, 66, 184.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/18/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 36, 66, 187);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/31/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 36.5, 66, 190);
    
    // For the last 3 records, the girth and height stay the same, but the weight is variable on the same day.
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/03/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 32, 66, 137.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/08/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 32.5, 66, 138);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 31, 66, 134);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 31, 66, 133.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 31, 66, 134.5);
  • 6. Re: How to pull a max value/first value for duplicates in a group in a query?
    Frank Kulash Guru
    Currently Being Moderated
    Hi,
    987019 wrote:
    Here's some sample data:
    CREATE TABLE TBLPATIENT
    (
    PATID VARCHAR2 (20),
    EPISODE_NUMBER DOUBLE,
    DATE_OF_DISCHARGE DATE
    );
    
    CREATE TABLE TBLPROGRESSNOTES
    (
    PATID VARCHAR2 (20),
    EPISODE_NUMBER DOUBLE,
    DATA_ENTRY_DATE DATE,
    GIRTH VARCHAR2 (5),
    HEIGHT DOUBLE,
    WEIGHT DOUBLE,
    );
    Thanks. I had to make some changes to get it to run:
    CREATE TABLE TBLPATIENT
    (
            PATID               VARCHAR2 (20),
            EPISODE_NUMBER           BINARY_DOUBLE,     -- There's no DOUBLE data type in SQL
            DATE_OF_DISCHARGE      DATE
    );
    
    DROP TABLE     tblprogressnotes;
     
    CREATE TABLE TBLPROGRESSNOTES
    (
            PATID          VARCHAR2 (20),
            EPISODE_NUMBER      NUMBER,          -- Most people use NUMBER for all numeric types
            ENTRY_DATE      DATE,          -- DATA_entry date is a good name, too, just be consistent
            GIRTH           NUMBER,          -- Can't average VARCHAR2s
            HEIGHT          NUMBER,
            WEIGHT           NUMBER          -- no comma here
    );
    INSERT INTO TBLPATIENT VALUES (1, 1);
    INSERT INTO TBLPATIENT VALUES (2, 1);
    
    // For the first 3 records, the height stays the same, but the girth and weight values are variable on the same day
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 36, 66, 184);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 35.5, 66, 185);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 35, 66, 184.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/18/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 36, 66, 187);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/31/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 36.5, 66, 190);
    
    // For the last 3 records, the girth and height stay the same, but the weight is variable on the same day.
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/03/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 32, 66, 137.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/08/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 32.5, 66, 138);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 31, 66, 134);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 31, 66, 133.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH:MM:SS'), 31, 66, 134.5);
     
    INSERT INTO TBLPATIENT VALUES (1, 1, NULL);
    -- If the table has 3 columns,     ^^^^^^  INSERT 3 values (or say which columns you're INSERTing)
    INSERT INTO TBLPATIENT VALUES (2, 1, NULL);
     
    // For the first 3 records, the height stays the same, but the girth and weight values are variable on the same day
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 36, 66, 184);
    --                                                             MM = month  ^^            ^^ MI = minutes 
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 35.5, 66, 185);
    --                                                         Hour 00  ^^  not valid for HH   ^^^^  use HH24 instead
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 35, 66, 184.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/18/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 36, 66, 187);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/31/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 36.5, 66, 190);
     
    // For the last 3 records, the girth and height stay the same, but the weight is variable on the same day.
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/03/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 32, 66, 137.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/08/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 32.5, 66, 138);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 31, 66, 134);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 31, 66, 133.5);
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/19/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 31, 66, 134.5);
    This seems to be different from the sample data you posted earlier. You didn't say what results you want from this data, so I don't know if this gets them or not:
    SELECT
            P.PATID,
            P.EPISODE_NUMBER,
            P.DATE_OF_DISCHARGE,
            M.ENTRY_DATE,
    --      M.ENTRY_TIME,          -- Not needed (not present in simplified sample data, anyway)
            AVG (M.GIRTH)     AS avg_girth,             -- AVG added
            AVG (M.HEIGHT)     AS avg_height,
            AVG (M.WEIGHT)     AS avg_weight
    FROM
            TBLPATIENT P LEFT OUTER JOIN
            TBLPROGRESSNOTES M ON
            (
                    (P.PATID = M.PATID) AND
                    (P.EPISODE_NUMBER = M.EPISODE_NUMBER)
            )
    WHERE
            P.DATE_OF_DISCHARGE IS NULL AND
            M.ENTRY_DATE BETWEEN (SYSDATE - 60) AND SYSDATE AND
            M.HEIGHT  != 0 AND        -- This site won't display the other inequlaity operator
            M.WEIGHT  != 0
    GROUP BY               -- GROUP BY clause added
            P.PATID,          -- Includes all columns from the SELECT clause that 
            P.EPISODE_NUMBER,     --      are not aggregated
            P.DATE_OF_DISCHARGE,
            M.ENTRY_DATE
    ORDER BY
            P.PATID,          -- No column called patIENTid
            M.ENTRY_DATE
    -- ,    M.ENTRY_TIME
    ;
    As you can see, it's very close to what you posted, and to what I suggested earlier: use AVG on the columns that you want to average, and GROUP BY the other columns. I marked all the places I changed with in-line comments.

    Since the hours, mintues and seconds of entry_date are always 00:00:00, then there's no need to use TRUNC (entry_date). Using it unnecessaily won't change the results, it will only waste a little time.
    By the way, if you omit the hours, minutes and seconds in TO_DATE, they default to 00:00:00, so you could make the insert statements a little simpler like this:
    INSERT INTO TBLPROGRESSNOTES VALUES (1, 1, TO_DATE('01/01/2013', 'MM/DD/YYYY'), 36, 66, 184);
    Output fro the query above:
    `     EPISODE
    PATID _NUMBER DATE_OF_DI ENTRY_DATE  AVG_GIRTH AVG_HEIGHT AVG_WEIGHT
    ----- ------- ---------- ---------- ---------- ---------- ----------
    1           1            01/01/2013       35.5         66      184.5
    1           1            01/03/2013         32         66      137.5
    1           1            01/08/2013       32.5         66        138
    1           1            01/18/2013         36         66        187
    1           1            01/19/2013         31         66        134
    1           1            01/31/2013       36.5         66        190

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points