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,
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
--
- 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 addresses. The following
: query returns all the
: -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 -
: From: Daniel Clark [EMAIL PROTECTED
Thanks for all the responses on how to import a dump file that will not
write over existing tables and not stop with an error on existing tables -
in other words just add missing tables. As Victoria pointed out, there is no
option in mysqldump to add the appropriate create table option [IF NOT
Hi, I am trying to use mysqldump to dump the structure of a single database
and want the output to make create table commands that include the IF NOT
EXISTS switch so that when the file is imported into an existing database it
does not write over tables with the same name. Does anyone know if
Hi, I have a MySQL table with a column that contains some of a web site
directory's category names in the format:
Sports:Football:Players
I am trying to build a query that that locates all records that match the
above category name OR if none exist its parent Sports:Football OR if none
exist
, if not, it needs to look for one
assigned to the parent category, so on and so on until it reaches the top
level category for which there will always be an ad.
Any suggestions/examples appreciated!
John
- Original Message -
From: Michael [EMAIL PROTECTED]
To: John Kelly [EMAIL PROTECTED