lundi 26 octobre 2015

PostgreSQL: Need to display "Ads" every N rows

Given, I have table Posts and have table Adverts. I have a webpage with posts (with infinite scroll).

I need to display row from Adverts table for every N rows from Posts table.

Is it possible to do using a single query?

What I want to achieve:

p01 p02 p03

p04 p05 p06

p07 a01 p08

p09 p10 p11

p12 p13 p14

a02 p15 p16

p17 p18 p19

p20 p21 a03

...




Aucun commentaire:

Enregistrer un commentaire