Selecting Min, Max with limits.

admin

Administrator
Staff member
I use the follow select statement :

$result = mysql_query("SELECT MIN(Average) as smallavg, MAX(Average) as bigavg FROM table WHERE Point = '$Point' ORDER BY Date DESC LIMIT 100",$db);

However, this gives me the Min and Max of the whole column.

I want it to only to give me the the min and max of the last 100 entries.

What code would make this work?


thanx
 
Back
Top