Re: How to aggregates this data

Поиск
Список
Период
Сортировка
От Chad Wagner
Тема Re: How to aggregates this data
Дата
Msg-id 81961ff50701101638v68f96965y2310a152d71f3d9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to aggregates this data  ("Chad Wagner" <chad.wagner@gmail.com>)
Список pgsql-sql
By the way, if you want to include that "incomplete" week before 12/1 (incomplete because it doesn't have a data point
forMonday) then you would do this:<br /><br /><br />select s1.asx_code, s1.wdate AS date, s1.low , s1.high, s2.open,
s3.close,s1.volume<br />from (select asx_code, date_trunc('week', date) AS wdate, min(date) AS bdate, max(date) AS
edate,min(low) AS low, max(high) AS high, SUM(volume) AS volume<br />      from sales_summaries <br />      group by
asx_code,date_trunc('week', date)) s1, sales_summaries s2, sales_summaries s3<br />where s1.bdate = s2.date<br />and
s1.asx_code=s2.asx_code<br/>and s1.edate = s3.date<br />and s1.asx_code=s3.asx_code ;<br /><br /><br /> 

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Chad Wagner"
Дата:
Сообщение: Re: How to aggregates this data
Следующее
От: "Marc Mamin"
Дата:
Сообщение: a way to generate functions dynamically ?