Jump to content

Need date from a row where MAX value is found


filo

Recommended Posts

This is a query i have, I guess this should be easy, but..  the problem is that date is always from first row in table and not from row where max temperature is found. 

SELECT
             date,
             MAX(Temp)
FROM
             table
WHERE  
             month = 04

 

 
So I guess I need a subquery
 
SELECT 
          ( 
              SELECT date
              FROM table
              HAVING MAX(Temp)
          ),
         MAX(Temp)
FROM
         table
WHERE
        month = 04
but this does the same thing, date is always first row from table. 
Any help greatly appreciated :)

 


 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.