From: Stuart Rison <stuart@ludwig.ucl.ac.uk>
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Re: [INTERFACES] the last row in a table
Date: Wed, 10 Mar 1999 11:38:39 +0000
Message-ID: <v04003a00b30c0982939e@[128.40.242.190]> (raw)
In-Reply-To: <Pine.SGI.3.95.990309112357.7669C-100000@bleu.west.spy.net>
References: <3.0.6.32.19990309183251.007fd2a0@mtl.pl>
>On Tue, 9 Mar 1999, Marcin Grondecki wrote:
>
># There is better answer, i think. Simply read smth about cursors -
># declaring, using, droping. I think this is what u need. In case of
># troubles with understanding, i'd serve with some examples in Perl.
>
> If it's the exact last input row you want, a trigger or rule would
>be still yet better. :)
Or another possibility (again, if it's the last inputed row you want) is
SELECT * FROM <table> WHERE oid=( SELECT max(oid::float) FROM <table> );
I'm assuming here that the largest the oid the latest it was put in...
that's right isn't it (he said, all of a sudden hesitant).
Also, I could only get this to work by typecasting oid as float. Anybody
know why?
Regards,
Stuart.
+-------------------------+--------------------------------------+
| Stuart Rison | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street |
| Tel. (0171) 878 4041 | London, W1P 8BT, UNITED KINGDOM. |
| Fax. (0171) 878 4040 | stuart@ludwig.ucl.ac.uk |
+-------------------------+--------------------------------------+
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-interfaces@postgresql.org
Cc: stuart@ludwig.ucl.ac.uk, pgsql-general@postgresql.org
Subject: Re: [GENERAL] Re: [INTERFACES] the last row in a table
In-Reply-To: <v04003a00b30c0982939e@[128.40.242.190]>
References: <3.0.6.32.19990309183251.007fd2a0@mtl.pl> <v04003a00b30c0982939e@[128.40.242.190]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox