Received: from grunt.candata.com (gateway.candata.com [204.225.91.106]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBDJ2kj16163 for ; Wed, 13 Dec 2000 14:02:46 -0500 (EST) (envelope-from steve@candata.com) Received: from candata.com (steve@grunt.candata.com [192.168.1.15]) by grunt.candata.com (8.9.3/8.9.3) with ESMTP id OAA18067 for ; Wed, 13 Dec 2000 14:03:20 -0500 Message-ID: <3A37C7F2.A39482E4@candata.com> Date: Wed, 13 Dec 2000 14:03:14 -0500 From: Steve Meynell Organization: CanData X-Mailer: Mozilla 4.74 [en] (X11; U; Linux 2.2.5-15 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Selecting Most Recent Row Content-Type: multipart/alternative; boundary="------------3FB08B666743E4FE417C32E7" X-Archive-Number: 200012/108 X-Sequence-Number: 442 --------------3FB08B666743E4FE417C32E7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ok here is the problem. Table: Widgets Fields: Unique_Key, DateStamp, Batch_Number, Instructions. Basic Select Statement: select Unique_Key from Widgets where Batch_Number>='inputedvalue' Problem: Some Batch_Numbers might be duplicated over a period of time. I want to select the most recent of these Batch Numbers. -- Steve Meynell Candata Systems --------------3FB08B666743E4FE417C32E7 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Ok here is the problem.
Table: Widgets
Fields:  Unique_Key, DateStamp, Batch_Number, Instructions.

Basic Select Statement:
select Unique_Key from Widgets where Batch_Number>='inputedvalue'

Problem:
Some Batch_Numbers might be duplicated over a period of time.  I want to select the most recent of these Batch Numbers.
 

-- 
Steve Meynell
Candata Systems
  --------------3FB08B666743E4FE417C32E7--