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

Поиск
Список
Период
Сортировка
От nathan wagner
Тема Re: Getting the count(*) from two tables and two date ranges in same query
Дата
Msg-id 479DEE06.8060605@hydaspes.if.org
обсуждение исходный текст
Ответ на Re: Getting the count(*) from two tables and two date ranges in same query  (Håkan Jacobsson <hakan.jacobsson@relevanttraffic.com>)
Список 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 по дате отправления:

Предыдущее
От: Håkan Jacobsson
Дата:
Сообщение: Re: Getting the count(*) from two tables and two date ranges in same query
Следующее
От: Sam Mason
Дата:
Сообщение: Re: Getting the count(*) from two tables and two date ranges in same query