Inject rows into query resultes

Поиск
Список
Период
Сортировка
От Alex Magnum
Тема Inject rows into query resultes
Дата
Msg-id CA+cR4zdzOpFjRf6OaeEnjmS3w9tYi6b7Zy5JVjLL62e+USJwpw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Inject rows into query resultes  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
Hi,
I am having a problem where I need to inject rows into a query result. That is

I have a list of add records, lets say car listings which I select from a table. The order of the results are given either by the user or default/initial.

I now want to inject featured car adds after every 5th record. (coming from the same table)

Right now, I am doing this on the PHP just calling the query twice but I am wondering if there is a way to only run one query.

The main problem is that 
a) i am using paging so the original listing should not be affected
b) the injected records should not be in the results returned for the current page.

Any one having an idea how to solve that?

Thanks 
Alex

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: numeric data type
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Inject rows into query resultes