Search Postgresql Archives

Re: Getting the count(*) from two tables and two date ranges in same query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
Please don't top-post.


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux