Re: [SQL] simple (?) join

2009-09-25 Thread Oliveiros C,
Hello, Justin, Gary. Justin, your (the second one) query is not much different from mine. You previewed the possibility of having orders without any matching entry on orders_log with your left join, something that I haven't. Gary, will you have records on your orders table that don't reference

Re: [SQL] simple (?) join

2009-09-25 Thread Claus Guttesen
> 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