N-tile function in postgres

Поиск
Список
Период
Сортировка
От Rachel Owsley
Тема N-tile function in postgres
Дата
Msg-id 81F2AED71E996746829AC866496B2EA373EC57EBFC@MAIL-NASH01.edo.local
обсуждение исходный текст
Ответы Re: N-tile function in postgres  (François Beausoleil <francois@teksol.info>)
Список pgsql-general

Hi,

 

Can anyone help me with an aggregate query I am having trouble with?

 

I want to get the top 5 or top 10 most frequently shopped in merchant categories for each account holder at a bank and put each of the quintiles/deciles into separate columns. I would also like to put the average transaction amount for each of those top 5-10 categories into separate columns, and the date of the last transaction in each of those 5 to 10 categories into separate columns. I am told that ntile may be an option for doing this, but can’t find any examples for using it in the documentation.

 

We use Postgresql 9.1.

 

Thank you so much for your help.

 

Rachel

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

Предыдущее
От: Bosco Rama
Дата:
Сообщение: Re: Prolem to acess PostgeSQL from other mechine
Следующее
От: François Beausoleil
Дата:
Сообщение: Re: N-tile function in postgres