POV-Ray : Newsgroups : povray.off-topic : Another stupid SQL query problem : Re: Another stupid SQL query problem Server Time
1 Oct 2024 05:20:26 EDT (-0400)
  Re: Another stupid SQL query problem  
From: Gail Shaw
Date: 22 Apr 2008 00:38:41
Message: <480d6bd1@news.povray.org>
"Halbert" <hal### [at] gmailcom> wrote in message
news:480d087b$1@news.povray.org...
> > 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.
>
> In reality, I need to select based on DK (a company identifier,)the script
> name and the date range but I think that it would be sufficient to return
> with only the email and the count.

Still very simple.

SELECT Email, Count(*)
FROM uselog
WHERE
Log_time >  '2008-01-31' and Log_time < '2008-03-01' and Script_Name =
'/EN/travelsync/content/getthere.asp' and DK = 'TEST'
group by Email


Post a reply to this message

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