Subject: Problem with displaying ID when finding max or min
Posted By: marcin2k Post Date: 9/28/2005 12:01:47 PM
Hello,
I am trying to make a summary table. I have a table with a bunch of data that contains like over 100 records for a single day. I am making a query to display the max and min temperatures for each day. Thats easy because I group by day and then use max and min but the tricky part is, How can I display the correct ID with this max or min. Each record has an ID associated with its record.

Thanks any help would be appreciated.
Marcin

Reply By: edammat Reply Date: 10/3/2005 7:42:44 AM
SELECT Max(TEMP.TEMP) AS Max, Min(TEMP.TEMP) AS Min, TEMP.DAY,
First(TEMP.ID) AS ID
FROM TEMP
GROUP BY TEMP.DAY;


Because THAT I Suppose EACH DAY HAVE THE SAME ID


Go to topic 33934

Return to index page 461
Return to index page 460
Return to index page 459
Return to index page 458
Return to index page 457
Return to index page 456
Return to index page 455
Return to index page 454
Return to index page 453
Return to index page 452