Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6AF6F634AA7 for ; Thu, 24 Sep 2009 13:55:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 20534-01 for ; Thu, 24 Sep 2009 16:55:22 +0000 (UTC) X-Greylist: delayed 01:38:42.074841 by SQLgrey-1.7.6 Received: from mail.ringways.co.uk (hub.ringways.co.uk [77.86.27.30]) by mail.postgresql.org (Postfix) with ESMTP id 56224632F76 for ; Thu, 24 Sep 2009 13:55:22 -0300 (ADT) Received: from eddie.ringways.co.uk ([10.1.1.115]) by mail.ringways.co.uk with esmtp (Exim 4.69) (envelope-from ) id 1MqpyO-0006oj-Lc for pgsql-sql@postgresql.org; Thu, 24 Sep 2009 16:11:10 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-sql@postgresql.org Subject: simple (?) join Date: Thu, 24 Sep 2009 16:16:36 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909241616.36933.gary.stainburn@ringways.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200909/116 X-Sequence-Number: 33181 Hi folks. I have two tables create table orders ( o_id serial primary key ... ); create table orders_log ( ol_id serial primary key, o_id int4 not null references orders(o_id), ol_timestamp timestamp, ol_user, ); How can I select all from orders and the last (latest) entry from the orders_log? Cheers -- Gary Stainburn Gary's Haircut 700 Please visit http://www.justgiving.com/Gary-Stainburn/ to help me raise money for Cancer Research - in return I'll have my head shaved