what i meant was just run the first query, and then the second, and print them separately
if getting the combined data onto single rows is important. and you don't want to massage it in your program, then you could combine the rows with a temp table something like this
Code:
create temptable
(theHour int, Raws int, Uniques int, Emails int)
insert into temptable
SELECT HOUR(traffic.time)
, COUNT(traffic.url)
, COUNT(DISTINCT traffic.ip)
, 0
FROM traffic
WHERE DAYOFYEAR(traffic.time) = DAYOFYEAR("2002-7-31")
group
by HOUR(traffic.time)
insert into temptable
SELECT HOUR(emails.collected)
, 0
, 0
, COUNT(DISTINCT emails.id)
FROM emails
WHERE DAYOFYEAR(emails.collected) = DAYOFYEAR("2002-7-31")
group
by HOUR(emails.collected)
select theHour
, sum(Raws) as Raws
, sum(Uniques) as Uniques
, sum(Emails) as Emails
from temptable
group
by theHour
rudy
Bookmarks