Re: Help con Select

From: Alejandra Bautista <alejandrabaut(at)gmail(dot)com>
To: Giorgio <giorgio(dot)pgsql(at)gmail(dot)com>
Cc: Postgresql <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Help con Select
Date: 2011-07-05 18:57:17
Message-ID: CAEi1B5YmP2-n2Y19Zp5DMV2U1JBKP1yj1Cbo5vRocgM=PUNiww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Podria ser algo asi:

SELECT MAX(version::integer), codigo, modular, nombre FROM socio GROUP BY
codigo, modular, nombre

El 5 de julio de 2011 09:51, Giorgio <giorgio(dot)pgsql(at)gmail(dot)com> escribió:

> Hola amigos espero me puedan ayudar, tengo una tabla socio mas o menos así:
>
> codigo..version.._modular............nombre
> 00001 01 7000000483 ALARCON ORTIZ SILVIA ESDENKA
> 00001 02 7000000483 ALARCON ORTIZ SILVIA ESDENKA
> 00002 01 1031125501 ALBINAGORTA REYNOSO HERLINDA ISABEL
> 00003 01 8000000872 ALFARO AGUERO PABLO RENE
> 00004 01 1031148858 ALTAMIRANO VARGAS AUGUSTO
> 00004 02 1031148858 ALTAMIRANO VARGAS AUGUSTO
> 00004 03 1031148858 ALTAMIRANO VARGAS AUGUSTO
> 00005 01 1031152138 ALTAMIRANO VARGAS ELIAS
> 00006 01 1031125811 ALTAMIRANO VIVANCO LUISA
> 00006 02 1031125811 ALTAMIRANO VIVANCO LUISA
> 00006 03 1031125811 ALTAMIRANO VIVANCO LUISA
> 00006 04 1031125811 ALTAMIRANO VIVANCO LUISA
>
> Donde version es el campo que diferencia el numero de version en la que se
> registra a un socio
>
> Quisiera obtener solo las ultimas versiones, teniendo en cuenta que un
> socio puede tener una version 03 o 04, la idea es que quede asi:
>
> codigo..version.._modular............nombre
> 00001 02 7000000483 ALARCON ORTIZ SILVIA ESDENKA
> 00002 01 1031125501 ALBINAGORTA REYNOSO HERLINDA ISABEL
> 00003 01 8000000872 ALFARO AGUERO PABLO RENE
> 00004 03 1031148858 ALTAMIRANO VARGAS AUGUSTO
> 00005 01 1031152138 ALTAMIRANO VARGAS ELIAS
> 00006 04 1031125811 ALTAMIRANO VIVANCO LUISA
>
>
>
>

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Arcel Labrada Batista 2011-07-05 20:43:30 Re: Help con Select
Previous Message Arcel Labrada Batista 2011-07-05 18:44:27 Re: Help con Select