Da asta este ! Merci frumos! PS. O solutie data de cineva pe lista de la postgres:
SELECT DISTINCT ON (gc) gc, co, data, ora FROM temp50 ORDER BY gc, ora DESC; > On Mon, 25 Oct 2004, cristivoinicaru wrote: > > > PS. Rezulatatul include cel putin campul gc si co (acestea sunt importante). > > De optimizarea acestui query te ocupi tu: > > SELECT a.gc, a.co, a.data, a.ora > FROM temp50 a > WHERE a.ora=(SELECT MAX(b.ora) FROM temp50 b WHERE b.gc=a.gc) AND > a.co=(SELECT b.co FROM temp50 b WHERE b.gc=a.gc LIMIT 1) > ORDER BY a.ora DESC; > > -- > Any views or opinions presented within this e-mail are solely those of > the author and do not necessarily represent those of any company, unless > otherwise expressly stated. > > --- > Detalii despre listele noastre de mail: http://www.lug.ro/ > --- Detalii despre listele noastre de mail: http://www.lug.ro/
