Re: generating the average 6 months spend excluding first orders

Поиск
Список
Период
Сортировка
От Ron256
Тема Re: generating the average 6 months spend excluding first orders
Дата
Msg-id 1417024519548-5828385.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: generating the average 6 months spend excluding first orders  (David G Johnston <david.g.johnston@gmail.com>)
Ответы Re: generating the average 6 months spend excluding first orders  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-sql
David, I made a few changes to my query and looks like I am moving in the
right direction
I have also attached my output.

WITH first_cust_cte AS
(SELECT min(ord_submitted_date)ord_date    , persistent_key_strFROM ordersgroup by persistent_key_str
)
SELECT o.persistent_key_str, o.ord_idFROM orders o INNER JOIN first_cust_cte cON o.persistent_key_str =
c.persistent_key_strWHEREord_submitted_date = ord_date
 
<http://postgresql.nabble.com/file/n5828385/First_time_orders.png> 

Thanks,

Ron



--
View this message in context:
http://postgresql.nabble.com/generating-the-average-6-months-spend-excluding-first-orders-tp5828253p5828385.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: generating the average 6 months spend excluding first orders
Следующее
От: David G Johnston
Дата:
Сообщение: Re: generating the average 6 months spend excluding first orders