RE: newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

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

 



Just keep in mind that while that may be a very possible solution when
datasets are small. This could get problematic when for instance there are a
10 years worth of dates and millions of records in the other tables. The
resulting program could end up taking lots of time to display data. In your
case this might not happen if you do not get that much data, but again we do
not know.

Just something to keep in mind before deploying.

Jack

-----Original Message-----
From: Govinda [mailto:govinda.webdnatalk@xxxxxxxxx] 
Sent: Tuesday, August 04, 2009 12:34 AM
To: php-db@xxxxxxxxxxxxx
Subject: Re:  newbie: how to return one iteration *per unique date
(DAY!)* in a timestamp column?

Bastien,
I had tried it with the parantheses around the date for the distinct.   
I tried again just now.  Same result.  But that's ok.  I am onto the  
next step now.

Niel, Jack,
I got your fix working.  It shows me that I am still so new; I own yet  
so little mastery of MySQL.

Nisse, I see what you are suggesting.  It seems I can go that route  
too.  I have much to learn in every direction, so for right now anyway  
I am thinking to pursue the stream of thought started with what Niel  
and Jack just gave me.

I do need data from the other columns too, and not just the date  
extracted from that timestamp field, ...and I need to count # of  
records in other tables that have the same unique date as the list of  
unique dates I just found in my first table, etc.

.. 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 need to play with everything before asking for more detailed help; I  
am just now asking if you think I am on the right track with my  
thinking - as I just mentioned in the sentence above this one?

Thanks everyone!
-Govinda

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

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.40/2276 - Release Date: 08/01/09
18:04:00


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux