grabbing the range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let's say I have 100 rows in the database, I need to loop throw them
ten at a time and for each set grab the max and min ages...I then need
to return a multi-dimensional array of all the ranges...I basically
want to do this but of course this query won't work:

***this is just pseudo code***

I would run this query for each set and return max and min ages into the array.
			
     select max(age) as max_age, min(age) as min_age
			    	  from customers  limit 10,20;

How should I do this?  Do I have to run a query like this:
   select  age from customers limit 10,20 

and loop through the result set putting all these values into an array
and then pull the min and max out of the array?
     
Hope this makes sense.

Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux