simple (?) join

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: simple (?) join
Date: 2009-09-24 15:16:36
Message-ID: 200909241616.36933.gary.stainburn@ringways.co.uk
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliveiros C, 2009-09-24 17:17:06 Re: simple (?) join
Previous Message Mark J Camilleri 2009-09-24 07:43:41 Re: SQL Subqueries on each result row