Help for construct Query

From: "Viaris hotmail" <viaris(at)hotmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Help for construct Query
Date: 2003-11-21 15:22:43
Message-ID: Law10-OE45Q7LfVdLf200008b12@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Chris Boget 2003-11-21 15:30:27 Re: Help for construct Query
Previous Message Michael Grant 2003-11-21 15:22:37 Re: Postmaster running, psql not