* John Kelly
> I have a table of full URLs and IPs and am using the following
> query to return
> distinct web requests by domain. Using SUBSTRING_INDEX it only returns the
> domain part of the URL:
>
> SELECT SUBSTRING_INDEX(url, '/', 3) as topsites, count(distinct
> ip) as count
> from tablename
I have a table of full URLs and IPs and am using the following query to return
distinct web requests by domain. Using SUBSTRING_INDEX it only returns the
domain part of the URL:
SELECT SUBSTRING_INDEX(url, '/', 3) as topsites, count(distinct ip) as count
from tablename WHERE SUBSTRING_INDEX(url, '
; To: [EMAIL PROTECTED]
: > Cc: [EMAIL PROTECTED]
: > Subject: Re: Need help constructing query ...
: >
: >
: > - Original Message -
: > From: "Daniel Clark" <[EMAIL PROTECTED]>
: > To: <[EMAIL PROTECTED]>
: > Cc: <[EMAIL PROTECTED]>
: >
: > -Original Message-
: > From: John Kelly [mailto:[EMAIL PROTECTED]
: > Sent: Tuesday, October 21, 2003 3:45 PM
: > To: [EMAIL PROTECTED]
: > Cc: [EMAIL PROTECTED]
: > Subject: Re: Need help constructing query ...
: >
: >
: > - Original Message -
: >
help constructing query ...
>
>
> - Original Message -
> From: "Daniel Clark" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 21, 2003 2:33 PM
> Subject: Re: Need help constructing query .
- Original Message -
From: "Daniel Clark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 21, 2003 2:33 PM
Subject: Re: Need help constructing query ...
: > Hi, I have a table full of logged urls and ip add
> Hi, I have a table full of logged urls and ip addresses. The following
> query returns all the urls and the number of requests. How would I
> modify it to return unique requests based on distinct ip addresses?
>
> select url, count(*) as pageviews from table group by url order by
> pageviews desc
Hi, I have a table full of logged urls and ip addresses. The following query
returns all the urls and the number of requests. How would I modify it to return
unique requests based on distinct ip addresses?
select url, count(*) as pageviews from table group by url order by pageviews
desc
--
MySQ