RE: Help with subqueries... MAX() and GROUP BY [sovled]

2006-04-29 Thread Shawn Green
--- Daevid Vincent <[EMAIL PROTECTED]> wrote: > Well I think this is mostly working. I have a 'NULL' user ID which is > 'system' that I need to get into here, but I think I'm mostly on > track... > > There are lots of ways to accomplish this task it seems. ALL of which > would > be so much easi

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Pat Adams
On Fri, 2006-04-28 at 00:13 -0700, Daevid Vincent wrote: > The problem is now that I can't get the right data. > > mysql> select max(created_on), user_id, id from logs group by user_id; > +-+-++ > | max(created_on) | user_id | id | > +-+

RE: Help with subqueries... MAX() and GROUP BY [sovled]

2006-04-28 Thread Daevid Vincent
| | 431 | 2 | 2006-04-27 22:18:35 | Viewed Users Stats | bob | +-+-+-++--+ From: Alex Arul [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 2:18 AM To: D

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Daevid Vincent
> Thanks Alex, that got me started. I don't understand why I > had to use "IN" > when the example uses "=" but at least it kinda works... > > The problem is now that I can't get the right data. > > mysql> select max(created_on), user_id, id from logs group by user_id; > +-+-

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Daevid Vincent
> -Original Message- > From: Alex Arul [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 27, 2006 11:28 PM > To: Daevid Vincent > Cc: mysql@lists.mysql.com > Subject: Re: Help with subqueries... > > On 4/28/06, Daevid Vincent <[EMAIL PROTECTED]> wrote: &

Re: Help with subqueries...

2006-04-27 Thread Alex Arul
On 4/28/06, Daevid Vincent <[EMAIL PROTECTED]> wrote: > > vmware reviewit # mysql --version > mysql Ver 14.12 Distrib 5.0.19, for pc-linux-gnu (i686) using readline > 5.1 > > Given two tables: > > CREATE TABLE `logs` ( > `id` bigint(20) unsigned NOT NULL auto_increment, > `user