Skip site navigation (1) Skip section navigation (2)

RE: Help con Select

From: gherzig(at)fmed(dot)uba(dot)ar
To: Lazaro Rubén García Martinez <lgarciam(at)vnz(dot)uci(dot)cu>
Cc: "Giorgio" <giorgio(dot)pgsql(at)gmail(dot)com>, "PostgreSQL" <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: RE: Help con Select
Date: 2011-07-06 22:33:31
Message-ID: 51777e54b72008ddd259dc12a19a26ea.squirrel@webmail.fmed.uba.ar (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
> Prueba con esto a ver qué tal:
>
> SELECT * FROM socio WHERE md5( CAST(socio.codigo AS varchar) ||
> CAST(socio.version_ AS varchar) ) IN
> (SELECT md5(CAST(socio.codigo AS VARCHAR) || CAST(max(socio.version_) AS
> VARCHAR)) from socio
> GROUP BY socio.codigo)
>
> Yo lo probé y funcionó.
>

Pero....para que el md5?
select * from socio where (codigo, version) in (select codigo,
max(version) from socio group by 1) deberia andar.

No?

Saludos.
Gerardo




In response to

Responses

pgsql-es-ayuda by date

Next:From: Lazaro Rubén García MartinezDate: 2011-07-06 22:34:40
Subject: RE: Help con Select
Previous:From: Jared LopezDate: 2011-07-06 20:23:43
Subject: Fwd: Mejora de consultas

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group