Help for construct Query - Mailing list pgsql-novice

From Viaris hotmail
Subject Help for construct Query
Date
Msg-id Law10-OE45Q7LfVdLf200008b12@hotmail.com
Whole thread Raw
List pgsql-novice
Hi all,

I have the following two tables, the table correo have the messages send
using the mail, the other table web have the message send using web.

I have the following query:

select SUBSTR(hora,1,2) as ho,count(*) as tot from web as a where
fecha='11/20/03' group by SUBSTR(hora,1,2);

select SUBSTR(hora,1,2) as ho,count(*) as tot from correo as a where
fecha='11/20/03' group by SUBSTR(hora,1,2);

my result is:

 hour | messages
------+---------
 00 |  35
 01 |   9
 02 |   4
 04 |   1
 05 |   9
 06 |  42
 07 | 132
 08 | 446
 09 | 505

But I need have only one query for both tables, I was trying but I can't,
how can I do it?

Thanks in Advanced.

pgsql-novice by date:

Previous
From: Michael Grant
Date:
Subject: Re: Postmaster running, psql not
Next
From: "Chris Boget"
Date:
Subject: Re: Help for construct Query