|
David W Noon wrote: On Thu, 24 Sep 2009 16:16:36 +0100, Gary Stainburn wrote about [SQL] simple (?) join: I don't think that is what he is requesting. I read it he also wants the timestamp included in the result set A nested query Select orders.*, (SELECT MAX(ol_timestamp) FROM orders_log where orders_log.o_id = orders.oid) >From orders Still another option is using a join Select orders.*, ol_timestamp From orders left join (SELECT MAX(ol_timestamp), o_id FROM orders_log group by o_id) as JoinQuery on JoinQuery.o_id = orders.o_id The second one should be faster |
- [SQL] simple (?) join Gary Stainburn
- Re: [SQL] simple (?) join Oliveiros C,
- Re: [SQL] simple (?) join Oliveiros C,
- Re: [SQL] simple (?) join David W Noon
- Re: [SQL] simple (?) join justin
- Re: [SQL] simple (?) join David W Noon
- Re: [SQL] simple (?) join justin
- Re: [SQL] simple (?) join David W Noon
- Re: [SQL] simple (?) join justin
- Re: [SQL] simple (?) join Gary Stainburn
- Re: [SQL] simple (?) join Oliveiros C,
- Re: [SQL] simple (?) join David W Noon
- Re: [SQL] simple (?) join Gary Stainburn
- Re: [SQL] simple (?) join Oliveiros C,
- Re: [SQL] simple (?) join justin
