Re: [SQL] get only rows for latest version of contents

2007-10-26 Thread Sébastien Meudec
Thx everybody. Regards Sebastien > -Message d'origine- > De : Erik Jones [mailto:[EMAIL PROTECTED] > Envoyé : jeudi 25 octobre 2007 16:35 > À : Sébastien Meudec > Cc : 'Christian Kindler'; pgsql-sql@postgresql.org > Objet : Re: [SQL] get only rows for latest

Re: [SQL] get only rows for latest version of contents

2007-10-25 Thread Erik Jones
ec Cc : pgsql-sql@postgresql.org Objet : Re: [SQL] get only rows for latest version of contents Hi! not quick mut works select * from business b1 where b1.version_no = (SELECT max(version_no) FROM business b2. where b2.idnode = b1.idnode ) If you wa

Re: [SQL] get only rows for latest version of contents

2007-10-24 Thread Sébastien Meudec
.org > Objet : Re: [SQL] get only rows for latest version of contents > > Hi! > > not quick mut works > > select * from business b1 > where b1.version_no = (SELECT max(version_no) FROM business b2. > where b2.idnode = b1.idnode >

Re: [SQL] get only rows for latest version of contents

2007-10-24 Thread Christian Kindler
Hi! not quick mut works select * from business b1 where b1.version_no = (SELECT max(version_no) FROM business b2. where b2.idnode = b1.idnode ) If you want to make this quiry faster du a regular join select b1.* from business b1, (SELECT

[SQL] get only rows for latest version of contents

2007-10-24 Thread Sébastien Meudec
Hi everybody. I have a table like that (i simplified it): CREATE TABLE business { idnode integer not null, version_no integer, c1 text, c2 text, c3 text } With a unique index in (idnode,version_no). This table records many version from contents identified by idnode where texts may be di