From: | Ramón Alberto Bruening González <albertobruening(at)hotmail(dot)com> |
---|---|
To: | Fernando Aguada <fernandoaguada(at)yahoo(dot)com(dot)ar>, <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | RE: Consulta Sencilla |
Date: | 2008-01-03 12:06:05 |
Message-ID: | BLU106-W154A8D17C6246EA2384286A2530@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
From: albertobruening(at)hotmail(dot)comTo: fernandoaguada(at)yahoo(dot)com(dot)ar; pgsql-es-ayuda(at)postgresql(dot)orgSubject: RE: [pgsql-es-ayuda] Consulta SencillaDate: Thu, 3 Jan 2008 12:02:44 +0000
> Hola,> necesito obtener un id, apartir de un select sobre una vista, en > la cual no tengo un campo autoincremental,> como puedo crear un campo resultado, que se autoincremente al hacer el > select? Buen dia a Todos y Felicidades por este año 2008. Mi idea seria que hagas lo siguiente: Select count(*) + 1 from tu_vista; Esto haria que aumente en 1 la cantidad de filas que tienes cada vez que consultes.
O tambien puedes realizar los siguiente:
Select max(id) + 1
from tu_vista; Espero te sirva.
Discover the new Windows Vista Learn more!
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
From | Date | Subject | |
---|---|---|---|
Next Message | Julio Cesar Sánchez González | 2008-01-03 12:42:16 | Re: Consulta Sencilla |
Previous Message | Ramón Alberto Bruening González | 2008-01-03 12:02:44 | RE: Consulta Sencilla |