union with count?

From: Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>
To: pgsql-sql(at)postgresql(dot)org
Subject: union with count?
Date: 2007-03-28 14:04:29
Message-ID: 460A75ED.6070501@fmed.uba.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi dudes, i have the following question
i have 2 tables with the same format, and i want to know if is there a
possibility of using some sort of count(*) for achieving this result:
select a from table1 where (condition) union select a from table2 where
(condition), count(a) group by a

The idea is having how many times (condition) is true for both tables.

Im not shure im explaining myself clearly, my english is not the best
(as you can see ;)

Thanks!
Gerardo

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma Jr 2007-03-28 14:10:26 Re: Regular Expressions [progress]
Previous Message Jon Horsman 2007-03-28 13:28:19 Re: Foreign Unique Constraint