This is a discussion on Re: Solution to retrieve first and last row for each minute within the pgsql Sql forums, part of the PostgreSQL category; --> Its really slow but what you can do is something like the following: select count(a.*), b.* from foo.bar a, ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Its really slow but what you can do is something like the following: select count(a.*), b.* from foo.bar a, ( select price from foo.bar order by time asc limit 1 union select price from foo.bar order by time desc limit 1 ) as b group by b.price ... just do the "wheres" as you need ... Chris PS its untested maybe there are some syntax miss-spells -- cu Chris Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |