POV-Ray : Newsgroups : povray.off-topic : Another stupid SQL query problem : Re: Another stupid SQL query problem Server Time
2 Nov 2024 14:46:37 EDT (-0400)
  Re: Another stupid SQL query problem  
From: Darren New
Date: 21 Apr 2008 17:30:19
Message: <480d076b$1@news.povray.org>
Halbert wrote:
>> Logtime, IP, Email
>> 2008/01/01 10:15, 10.2.45.56, me@here
>> 2008/01/01 10:25, 10.2.45.56, me@here
>> 2008/01/01 16:15, 10.2.78.156, me@here
>> 2008/01/02 12:15, 10.2.15.74, me@here
>> 2008/01/02 12:15, 10.2.15.74, me@here
>> 2008/01/02 12:17, 10.2.15.74, me@here
>> 2008/01/02 12:19, 10.2.15.74, me@here
>> 2008/01/01 12:15, 10.5.25.34, you@somewhere
>> 2008/01/01 13:15, 10.5.25.34, you@somewhere
>> 2008/01/01 14:15, 10.5.25.34, you@somewhere
>> 2008/01/01 18:15, 10.5.25.38, you@somewhere
>>
> 
> me@here,7
> you@somewhere,4

That's easy, then.

select email, count(*) from logtable where '2008-...' < logtime and 
logtime < '2008...' group by email

The "group by" (and possibly "with rollup" and "having" clauses) is what 
you need to read up on.

If you need one of the IP addresses or other columns to come back, it's 
harder.
-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.