Inject rows into query resultes - Mailing list pgsql-general

From Alex Magnum
Subject Inject rows into query resultes
Date
Msg-id CA+cR4zdzOpFjRf6OaeEnjmS3w9tYi6b7Zy5JVjLL62e+USJwpw@mail.gmail.com
Whole thread Raw
Responses Re: Inject rows into query resultes
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: numeric data type
Next
From: "David G. Johnston"
Date:
Subject: Re: Inject rows into query resultes