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 <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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 > > > >
