Re: Distinct Query Help
Felix,
Thank you for responding. It's difficult to believe that I've been at this all day, but your link helped me to determine the correct query.
(Unbeknownst to me, my host isn't running the latest version of MySQL (4.1), because it is currently unsupported by cPanel (?) So the subquery option was not available to me. I chased my tail around on that for a while, but fortunately, your link covers earlier versions as well.)
Running in a PHP environment, my solution looks like this:
mysql_query('create temporary table evo_onlineTemp ( ip varchar(40), timestamp integer(15), primary key (timestamp), index(ip) )');
mysql_query('insert into evo_onlineTemp (ip,timestamp) select ip, max(timestamp) from evo_online group by ip');
$getEM = mysql_query('select evo_online.ip, file, totIP, evo_online.timestamp from evo_online, evo_onlineTemp where evo_online.ip=evo_onlineTemp.ip and evo_online.timestamp=evo_onlineTemp.timestamp');
Thank you so much for the link. It was EXACTLY what the doctor ordered.
(Now ... all I need to do is determine the maximum number of characters for the "file" field, contained in the result, so I can set the window size accordingly. If it's not one thing, it's something else, eh?) Learning in a vaccuum is difficult!
Thanks again for your help.
Cheers,
Scott