Jump to content

Display every Nth record without using order by


Humpty

Recommended Posts

Got it. it was all in the SELECT DISTINCT on (field name), field, field etc...

 

select distinct on (t1.fixtureid)

       t1.fixtureid,

       t1.teamid,

       t1.score,

       t2.teamid,

       t2.score

  from results t1

  join results t2

    on t2.fixtureid = t1.fixtureid

where t2.teamid != t1.teamid;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.