Re: Getting the count(*) from two tables and two date ranges in same query - Mailing list pgsql-general

From nathan wagner
Subject Re: Getting the count(*) from two tables and two date ranges in same query
Date
Msg-id 479DEE06.8060605@hydaspes.if.org
Whole thread Raw
In response to Re: Getting the count(*) from two tables and two date ranges in same query  (Håkan Jacobsson <hakan.jacobsson@relevanttraffic.com>)
List pgsql-general
Håkan Jacobsson wrote:

  > I don't get it=). How do I input the second daterange in this query?

Through whatever mechanism you are using to issue the query.

 > Also, I have the ID from table1. Its known in the query.

Oops.  I forgot that part in my reply.  So my where clause is
wrong, though easily modified to add "and table1_id = foo".

 > Wouldn't I need to use a UNION for this kind of query?

A union will combine rows (if they're compatible) from two queries,
What you are asking is to assemble columns, which is entirely different.

--
nathan wagner
nw@hydaspes.if.org
Please don't top-post.


pgsql-general by date:

Previous
From: Håkan Jacobsson
Date:
Subject: Re: Getting the count(*) from two tables and two date ranges in same query
Next
From: Sam Mason
Date:
Subject: Re: Getting the count(*) from two tables and two date ranges in same query