Re: newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?
| From: | Ben Dunlap | Date: | Mon, 03 Aug 2009 18:20:23 +0000 |
| Subject: | Re: newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column? | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46390@lists.php.net to get a copy of this message | ||
Govinda wrote:
> .. so my thought is to want to do nested query(ies), where:
> *within* the while loop of the first recordset (which is now
> successfully returning just rows with unique dates), I do other
> query(ies) which will (in their own code block) find all rows of the
> date we are iterating.. so I can, for example, count number of records
> for each unique date, do math/statistics, etc.
I had to do something similar in code of my own a little while ago, and got
some very good guidance on Stack Overflow. Here's the thread, you might find it
helpful:
http://stackoverflow.com/questions/946214/one-sql-query-or-many-in-a-loop
The user whose answer is marked as the correct one ("Quassnoi") also writes a
helpful blog on SQL. You should be able to find the blog by clicking on the
username.
Ben