Received: from smtp03.primenet.com (daemon@smtp03.primenet.com [206.165.6.133]) by hub.org (8.9.2/8.9.1) with ESMTP id JAA39473 for ; Tue, 9 Mar 1999 09:18:49 -0500 (EST) (envelope-from kanet@calmarconsulting.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id HAA29808; Tue, 9 Mar 1999 07:17:52 -0700 (MST) Received: from ip-219-056.insightexpress.com(206.165.219.56), claiming to be "p2-400-death" via SMTP by smtp03.primenet.com, id smtpd029745; Tue Mar 9 07:17:49 1999 Message-ID: <000901be6a38$6e0840a0$38dba5ce@p2-400-death> From: "K.T." To: , Cc: , Subject: Re: [GENERAL] the last row in a table Date: Tue, 9 Mar 1999 09:23:35 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 How about... select field1 where primary_key = select max(primary_key) from table; or something like that :) I always mess up the parenthesis...cant remember whether or not they are needed here around the second select. -----Original Message----- From: hoelc To: pgsql-interfaces@postgreSQL.org Cc: pgsql-admin@postgreSQL.org ; pgsql-general@hub.org Date: Tuesday, March 09, 1999 7:03 AM Subject: [GENERAL] the last row in a table >Hello, >I am developing a database with PostgreSQL in Linux, and using ecpg to write the >C program to communicate with the database. >One of my application need to get the data from the last row in a table. >Is there any function or command that can tract which is the last row of data in >a table? >Thank you. >Regards, >lch > > > >