Received: from mail-b.bcc.ac.uk (mail-b.bcc.ac.uk [144.82.100.22]) by hub.org (8.9.2/8.9.1) with ESMTP id GAA88106 for ; Wed, 10 Mar 1999 06:49:34 -0500 (EST) (envelope-from stuart@ludwig.ucl.ac.uk) Received: from kestrel.ludwig.ucl.ac.uk by mail-b.bcc.ac.uk with SMTP (XT-PP); Wed, 10 Mar 1999 11:40:48 +0000 Received: from [128.40.242.190] by kestrel.ludwig.ucl.ac.uk (SMI-8.6/SMI-SVR4) id LAA19796; Wed, 10 Mar 1999 11:43:34 GMT X-Sender: stuart@kestrel.ludwig.ucl.ac.uk Message-Id: In-Reply-To: References: <3.0.6.32.19990309183251.007fd2a0@mtl.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 10 Mar 1999 11:38:39 +0000 To: pgsql-general@postgresql.org From: Stuart Rison Subject: Re: [GENERAL] Re: [INTERFACES] the last row in a table >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 WHERE oid=( SELECT max(oid::float) FROM
); 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 | +-------------------------+--------------------------------------+