Re: getting back autonumber ... Another MsSQL Comparation Question
От
jimmy.olsen
Тема
Re: getting back autonumber ... Another MsSQL Comparation Question
Дата
Msg-id
003c01c583b4$3e20b510$230a0a0a@ligaone.com.br
Список
Дерево обсуждения
getting back autonumber just inserted mail TechEvolution <mail@techevolution.be>
Re: getting back autonumber just inserted Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: getting back autonumber just inserted mail TechEvolution <mail@techevolution.be>
Re: getting back autonumber just inserted Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: getting back autonumber just inserted Theodore Petrosky <tedpet5@yahoo.com>
Re: getting back autonumber just inserted Scott Marlowe <smarlowe@g2switchworks.com>
Re: getting back autonumber just inserted mail TechEvolution <mail@techevolution.be>
Re: getting back autonumber just inserted Michael Fuhr <mike@fuhr.org>
Re: getting back autonumber just inserted Larry Meadors <larry.meadors@gmail.com>
Re: getting back autonumber just inserted Michael Fuhr <mike@fuhr.org>
Re: getting back autonumber just inserted PFC <lists@boutiquenumerique.com>
Re: getting back autonumber just inserted Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: getting back autonumber just inserted PFC <lists@boutiquenumerique.com>
Re: getting back autonumber just inserted Michael Fuhr <mike@fuhr.org>
Re: getting back autonumber just inserted PFC <lists@boutiquenumerique.com>
Re: getting back autonumber just inserted Michael Fuhr <mike@fuhr.org>
Re: getting back autonumber just inserted Larry Meadors <larry.meadors@gmail.com>
Re: getting back autonumber just inserted PFC <lists@boutiquenumerique.com>
Re: getting back autonumber just inserted Michael Fuhr <mike@fuhr.org>
Re: getting back autonumber just inserted Bruno Wolff III <bruno@wolff.to>
Re: getting back autonumber just inserted Bruno Wolff III <bruno@wolff.to>
Re: getting back autonumber just inserted Vivek Khera <vivek@khera.org>
int to date Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
Re: int to date Bruno Wolff III <bruno@wolff.to>
Hi Listers, I need to know the number of affected (Inserted, deleted, updated) rows by a Query. In MsSQL I use SELECT @@ROWCOUNT, similar to SELECT @@IDENTITY. Is there any @@RowCount similar statement in PostGres?? Alessandro - Liga One Sistemas alessandro@ligaone.com.br ----- Original Message ----- From: "Alvaro Herrera" To: "mail TechEvolution" Cc: Sent: Thursday, July 07, 2005 3:03 PM Subject: Re: [SQL] getting back autonumber just inserted > On Thu, Jul 07, 2005 at 07:50:16PM +0200, mail TechEvolution wrote: > > hello > > > > i ame a newbie to PostGreSQL, I ame using PostGreSQL 8.0 > > (windowsinstaller) on a xp prof platform > > > > i would like to get back the autonumber from the last record inserted, > > for other SQL db (m$ sql db ...) i could use: > > SELECT @@ IDENTITY > > > > can someone help me by informing me what the SQL syntax is to be used > > with PostGreSQL db and get the same result, the last autonumber inserted? > > You use the currval() function, using the name of the involved sequence > as parameter. There is a pg_get_serial_sequence() function, to which > you give the table name and column name, and it will give you the > sequence name. > > -- > Alvaro Herrera () > Oh, oh, las chicas galacianas, lo harán por las perlas, > ¡Y las de Arrakis por el agua! Pero si buscas damas > Que se consuman como llamas, ¡Prueba una hija de Caladan! (Gurney Halleck) > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >
В списке pgsql-sql по дате отправления
От: Michael Fuhr
Дата: