[GENERAL] postgresql how to duplicate rows in result.

Поиск
Список
Период
Сортировка
От Alessandro Baggi
Тема [GENERAL] postgresql how to duplicate rows in result.
Дата
Msg-id 508453e6-af91-c626-ad76-ea65737c27d9@gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] postgresql how to duplicate rows in result.  (Melvin Davidson <melvin6925@gmail.com>)
Re: [GENERAL] postgresql how to duplicate rows in result.  (Merlin Moncure <mmoncure@gmail.com>)
Re: [GENERAL] postgresql how to duplicate rows in result.  (John McKown <john.archie.mckown@gmail.com>)
Список pgsql-general
Hi list,
sorry for my english, I will try to example as well. I've a query that
joins multiple tables and return a result like:


id,customers,phone,code,number
1 , aaaaaaaa,33333,123 , 2
2 , aassdsds,33322,211 , 1
3 , oooooooo,21221,221 , 1


I need, where "number" field is > 1, to duplicate the row * N(number
field value) with a result like this:

id,customers,phone,code,number
1 , aaaaaaaa,33333,123 , 2
1 , aaaaaaaa,33333,123 , 2
2 , aassdsds,33322,211 , 1
3 , oooooooo,21221,221 , 1

How I can accomplish to this problem?

I'm using postgresql 9.3.15.

thanks in advance.

Alessandro.



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

Предыдущее
От: Mimiko
Дата:
Сообщение: Re: [GENERAL] database folder name and tables filenames
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: [GENERAL] database folder name and tables filenames