[thesite] rudy, this may intersest you..

Joshua Olson joshua at alphashop.com
Fri Oct 5 11:41:22 CDT 2001


: i'll think about it some more.. quicky question. how would i run that
: query and get the persons last login date too?
:
: select who,  lastlogin, createdate from users group by email having
: count(*) > 1
:
: is giving me a "Not a group by" expression.. sorry about the dumb
: questions, I'm only on page 75 of my "Learn to be Rudy in 21 days" book :)

I don't think that'll work because you cannot return this sort of row level
detail when you have a group by in there.

Try:

select who,  lastlogin, createdate
from users
where exists
  (select 1 from users u2
   where u2.email = users.email
        and u2.userid != user.userid)

Or something like that.  There may be some fancy group by variation, but
this aughta work (mind you, I'm not sure if userid is the correct fieldname)

-joshua





More information about the thesite mailing list